Packagegraphics.layouts
Classpublic class BoxLayout
InheritanceBoxLayout Inheritance CoreLayout Inheritance Object
Implements Directionable
Subclasses GridLayout

A Box layout lays out all children of a specific DisplayObjectContainer in a single vertical column or a single horizontal row. The direction property determines whether to use vertical (default) or horizontal layout.



Public Properties
 PropertyDefined By
 Inheritedalign : uint
The alignement of the layout.
CoreLayout
 Inheritedbounds : Rectangle
A rectangle that defines the area of the layout.
CoreLayout
  childCount : int
Determinates the number of childs visible in this layout to calculates size with the measure method.
BoxLayout
 Inheritedcontainer : DisplayObjectContainer
Indicates the container reference to change with the layout.
CoreLayout
  direction : String
Indicates the direction value of this layout ("horizontal" or "vertical").
BoxLayout
  horizontalGap : Number
Number of pixels between children in the horizontal direction.
BoxLayout
 InheritedmeasuredHeight : Number
The default height of the component, in pixels.
CoreLayout
 InheritedmeasuredWidth : Number
The default width of the component, in pixels.
CoreLayout
  order : String
Indicates the direction order of to layout all children in the container.
BoxLayout
  padding : EdgeMetrics
Specifies the thickness, in pixels, of the four edge regions around the box layout.
BoxLayout
  propHeight : String = height
The height property name use in the container to layout all items.
BoxLayout
  propWidth : String = width
The width property name use in the container to layout all items.
BoxLayout
  propX : String = x
The x property name use in the container to layout all items.
BoxLayout
  propY : String = y
The y property name use in the container to layout all items.
BoxLayout
 Inheritedrenderer : Signaler
This signal emit before the rendering is started.
CoreLayout
 Inheritedudpater : Signaler
This signal emit when the rendering is finished.
CoreLayout
  verticalGap : Number
Number of pixels between children in the vertical direction.
BoxLayout
Protected Properties
 PropertyDefined By
 Inherited_bounds : Rectangle
The absolute rectangle bound area calculate with the measure method.
CoreLayout
Public Methods
 MethodDefined By
  
BoxLayout(container:DisplayObjectContainer = null, init:Object = null, auto:Boolean = false)
Creates a new BoxLayout instance.
BoxLayout
  
getChildPositionAt(n:Number):Point
Returns the child position with the specified index and the current direction of this layout.
BoxLayout
  
Returns the string representation of the coordinate attribute used in this display with the current direction value.
BoxLayout
  
Returns the string representation of the size attribute with the current direction.
BoxLayout
 Inherited
isLocked():Boolean
Returns true if the object is locked.
CoreLayout
  
isVertical():Boolean
Indicates if the layout is vertical.
BoxLayout
 Inherited
lock():void
Locks the object.
CoreLayout
  
measure():void
[override] Calculates the default sizes and minimum and maximum values.
BoxLayout
  
render():void
[override] Render the layout, refresh and change the position of all childs in a specific container.
BoxLayout
 Inherited
resetLock():void
Reset the lock security of the display.
CoreLayout
 Inherited
run(... arguments):void
Run the layout (render and update).
CoreLayout
 Inherited
unlock():void
Unlocks the display.
CoreLayout
  
update():void
[override] This method is invoked when the rendering is finished to finalize the it after the measure invokation.
BoxLayout
Property Detail
childCountproperty
childCount:int

Determinates the number of childs visible in this layout to calculates size with the measure method. If this value is -1 all childs are used to calculate the visible area size else only the number of childs defines with the childCount attribute.


Implementation
    public function get childCount():int
    public function set childCount(value:int):void
directionproperty 
direction:String

Indicates the direction value of this layout ("horizontal" or "vertical").


Implementation
    public function get direction():String
    public function set direction(value:String):void

See also

horizontalGapproperty 
horizontalGap:Number

Number of pixels between children in the horizontal direction. The default value depends on the component class; if not overriden for the class, the default value is 0.


Implementation
    public function get horizontalGap():Number
    public function set horizontalGap(value:Number):void
orderproperty 
order:String

Indicates the direction order of to layout all children in the container. This property can be define with the two constants DirectionOrder.NORMAL and DirectionOrder.REVERSE.


Implementation
    public function get order():String
    public function set order(value:String):void

See also

paddingproperty 
padding:EdgeMetrics

Specifies the thickness, in pixels, of the four edge regions around the box layout.


Implementation
    public function get padding():EdgeMetrics
    public function set padding(value:EdgeMetrics):void
propHeightproperty 
public var propHeight:String = height

The height property name use in the container to layout all items.

propWidthproperty 
public var propWidth:String = width

The width property name use in the container to layout all items.

propXproperty 
public var propX:String = x

The x property name use in the container to layout all items.

propYproperty 
public var propY:String = y

The y property name use in the container to layout all items.

verticalGapproperty 
verticalGap:Number

Number of pixels between children in the vertical direction. The default value depends on the component class; if not overriden for the class, the default value is 0.


Implementation
    public function get verticalGap():Number
    public function set verticalGap(value:Number):void
Constructor Detail
BoxLayout()Constructor
public function BoxLayout(container:DisplayObjectContainer = null, init:Object = null, auto:Boolean = false)

Creates a new BoxLayout instance.

Parameters
container:DisplayObjectContainer (default = null) — The container to layout.
 
init:Object (default = null) — An object that contains properties with which to populate the newly layout object. If init is not an object, it is ignored.
 
auto:Boolean (default = false) — This boolean indicates if the layout is auto running or not (default false).
Method Detail
getChildPositionAt()method
public function getChildPositionAt(n:Number):Point

Returns the child position with the specified index and the current direction of this layout.

Parameters

n:Number

Returns
Point — the child position with the specified index and the current direction of this layout.
getCoordinateProperty()method 
public function getCoordinateProperty():String

Returns the string representation of the coordinate attribute used in this display with the current direction value.

Returns
String — the string representation of the coordinate attribute used in this display with the current direction value.
getSizeProperty()method 
public function getSizeProperty():String

Returns the string representation of the size attribute with the current direction.

Returns
String — the string representation of the size attribute with the current direction.
isVertical()method 
public function isVertical():Boolean

Indicates if the layout is vertical.

Returns
Boolean
measure()method 
override public function measure():void

Calculates the default sizes and minimum and maximum values. If the Box layout's direction property is set to Direction.HORIZONTAL, its measuredWidth property is equal to the sum of default widths of all of the children in the container, plus the thickness of the borders (padding), plus the left and right padding, plus the horizontal gap between each child. The value of the measuredHeight property is the maximum of all the children's default heights, plus room for the borders and padding. If the Box layout's direction property is set to Direction.VERTICAL, these two values are reversed.

render()method 
override public function render():void

Render the layout, refresh and change the position of all childs in a specific container.

update()method 
override public function update():void

This method is invoked when the rendering is finished to finalize the it after the measure invokation.