168
Creating Advanced Visual Components in ActionScript
The properties have the following values:
unscaledWidth
Specifies the width of the component, in pixels, in the component’s
coordinates, regardless of the value of the
scaleX
property of the component. This is the
width of the component as determined by its parent container.
unscaledHeight
Specifies the height of the component, in pixels, in the component’s
coordinates, regardless of the value of the
scaleY
property of the component. This is the
height of the component as determined by its parent container.
Scaling occurs in Flash Player, after
updateDisplayList()
executes. For example, a
component with an
unscaledHeight
value of 100, and with a
scaleY
property of 2.0,
appears 200 pixels high in Flash Player.
Overriding the layout mechanism of the VBox container
The
VBox
container lays out its children from the top of the container to the bottom of the
container in the order in which the children are added to the container. The following
example overrides the
updateDisplayList()
method, which causes the VBox container to
layout its children from the bottom of the container to the top:
package myComponents
{
// asAdvanced/myComponents/BottomUpVBox.as
import mx.containers.VBox;
import mx.core.EdgeMetrics;
import mx.core.UIComponent;
public class BottomUpVBox extends VBox
{
public function BottomUpVBox() {
super();
}
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
// Get information about the container border area.
// The usable area of the container for its children is the
// container size, minus any border areas.
var vm:EdgeMetrics = viewMetricsAndPadding;
// Get the setting for the vertical gap between children.
var gap:Number = getStyle("verticalGap");
// Determine the y coordinate of the bottom of the usable area
Содержание FLEX 2 - CREATING AND EXTENDING COMPONENTS
Страница 1: ...Creating and Extending Flex 2 Components Adobe Flex 2...
Страница 6: ...6 Contents...
Страница 10: ...10 About Flex Documentation...
Страница 12: ......
Страница 24: ...24 Creating Flex Components...
Страница 74: ...74 Compiling Components...
Страница 76: ......
Страница 118: ...118 Creating Advanced MXML Components...
Страница 120: ......
Страница 182: ...182 Creating Advanced Visual Components in ActionScript...
Страница 194: ...194 Creating Custom Style Properties...
Страница 204: ...204 Creating Template Components...
Страница 206: ......
Страница 216: ...216 Creating Custom Formatters...
Страница 254: ...254 Index...