Packagecom.yahoo.astra.layout.modes
Classpublic class FlowLayout
InheritanceFlowLayout Inheritance BaseLayoutMode Inheritance flash.events.EventDispatcher
ImplementsIAdvancedLayoutMode

Arranges a DisplayObjectContainer's children using a flow algorithm. When a child is too large for a row or column, a new row or column is created. Similar to the flow of text in a document.


Example
The following code configures a FlowLayout instance and passes it to a container:
  var flow:FlowLayout = new FlowLayout();
  flow.direction = "horizontal";
  flow.horizontalGap = 1;
  flow.verticalGap = 4;
  flow.verticalAlign = VerticalAlignment.BOTTOM;
  
  var container:LayoutContainer = new LayoutContainer();
  container.layoutMode = flow;
  this.addChild( container );
  

Advanced Client Options:

Optional client configuration parameters allow a developer to specify behaviors for individual children of the target container. To set these advanced options, one must call addClient() on the FlowLayout instance and pass the child to configure along with an object specifying the configuration parameters. The following client parameters are available to the FlowLayout algorithm:

includeInLayout : Boolean
If false, the target will not be included in layout calculations. The default value is true.

See also

com.yahoo.astra.layout.LayoutContainer


Public Properties
 PropertyDefined by
  direction : String
The direction in which children of the target are laid out.
FlowLayout
  horizontalAlign : String
The horizontal alignment of children displayed in the target.
FlowLayout
  horizontalGap : Number
The number of pixels appearing between the target's children horizontally.
FlowLayout
 InheritedpaddingBottom : Number
The number of pixels displayed at the bottom of the target's children.
BaseLayoutMode
 InheritedpaddingLeft : Number
The number of pixels displayed at the left of the target's children.
BaseLayoutMode
 InheritedpaddingRight : Number
The number of pixels displayed at the right of the target's children.
BaseLayoutMode
 InheritedpaddingTop : Number
The number of pixels displayed at the top of the target's children.
BaseLayoutMode
  verticalAlign : String
The vertical alignment of children displayed in the target.
FlowLayout
  verticalGap : Number
The number of pixels appearing between the target's children vertically.
FlowLayout
Public Methods
 MethodDefined by
  
Constructor.
FlowLayout
 Inherited
addClient(target:DisplayObject, configuration:Object = null):void
Registers a specific display object with the layout algorithm.
BaseLayoutMode
 Inherited
hasClient(target:DisplayObject):Boolean
Returns true if a display object has been registered as a client.
BaseLayoutMode
  
layoutObjects(displayObjects:Array, bounds:Rectangle):Rectangle
The DisplayObjects in the input parameter will be positioned and sized based on a specified rectangle.
FlowLayout
 Inherited
removeClient(target:DisplayObject):void
Unregisters a specific display object from the layout algorithm.
BaseLayoutMode
Property detail
directionproperty
direction:String  [read-write]

The direction in which children of the target are laid out. Once the edge of the container is reached, the children will begin appearing on the next row or column. Valid direction values include "vertical" or "horizontal".

Implementation
    public function get direction():String
    public function set direction(value:String):void
horizontalAlignproperty 
horizontalAlign:String  [read-write]

The horizontal alignment of children displayed in the target.

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

See also

horizontalGapproperty 
horizontalGap:Number  [read-write]

The number of pixels appearing between the target's children horizontally.

Implementation
    public function get horizontalGap():Number
    public function set horizontalGap(value:Number):void
verticalAlignproperty 
verticalAlign:String  [read-write]

The vertical alignment of children displayed in the target.

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

See also

verticalGapproperty 
verticalGap:Number  [read-write]

The number of pixels appearing between the target's children vertically.

Implementation
    public function get verticalGap():Number
    public function set verticalGap(value:Number):void
Constructor detail
FlowLayout()constructor
public function FlowLayout()

Constructor.

Method detail
layoutObjects()method
public override function layoutObjects(displayObjects:Array, bounds:Rectangle):Rectangle

The DisplayObjects in the input parameter will be positioned and sized based on a specified rectangle. There is no requirement that the display objects remain entirely within the rectangle.

Returns the actual rectangular region in which the laid out children will appear. This may be larger or smaller than the suggested rectangle. This returned value is expected to be used by container components to determine if scrollbars or other navigation controls are needed.

Parameters
displayObjects:Array — An Array of DisplayObjects to be laid out.
 
bounds:Rectangle — The rectangular region in which the display objects should be placed.

Returns
Rectangle — The actual region in which the display objects are contained.