Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 168

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

The properties have the following values:
Specifies the width of the component, in pixels, in the component's
unscaledWidth
coordinates, regardless of the value of the
width of the component as determined by its parent container.
Specifies the height of the component, in pixels, in the component's
unscaledHeight
coordinates, regardless of the value of the
height of the component as determined by its parent container.
Scaling occurs in Flash Player, after
component with an
unscaledHeight
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
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
168
Creating Advanced Visual Components in ActionScript
scaleX
scaleY
updateDisplayList()
value of 100, and with a
updateDisplayList()
property of the component. This is the
property of the component. This is the
executes. For example, a
scaleY
method, which causes the VBox container to
property of 2.0,

Advertisement

Table of Contents
loading

Table of Contents