Packagecom.gestureworks.cml.layouts
Classpublic class ListLayout
InheritanceListLayout Inheritance LayoutFactory Inheritance ObjectFactory Inheritance flash.events.EventDispatcher

The ListLayout positions the display objects in a list.
        
        //horizontal list layout 
        var h_list:Container = getImageContainer();
        h_list.x = 475;
        h_list.y = 25;
        addChild(h_list);
                    
        var horiztonalLayout:ListLayout = new ListLayout();
        horiztonalLayout.spacingX = 200;
        horiztonalLayout.tween = true;
        horiztonalLayout.tweenTime = 1500;
        h_list.applyLayout(horiztonalLayout);
        
        //vertical list layout
        var v_list:Container = getImageContainer();
        v_list.x = 750;
        v_list.y = 200;
        addChild(v_list);
                    
        var verticalLayout:ListLayout = new ListLayout();
        verticalLayout.type = "vertical";
        verticalLayout.useMargins = true;
        verticalLayout.marginY = 5;
        verticalLayout.tween = true;
        verticalLayout.tweenTime = 1500;
        v_list.applyLayout(verticalLayout);        

        
        function getImageContainer():Container
        {
            var container:Container = new Container();
            container.addChild(getImageElement("../../../../assets/images/plane.jpg"));            
            container.addChild(getImageElement("../../../../assets/images/plane.jpg"));            
            container.addChild(getImageElement("../../../../assets/images/plane.jpg"));            
            container.addChild(getImageElement("../../../../assets/images/plane.jpg"));            
            container.addChild(getImageElement("../../../../assets/images/plane.jpg"));            
            container.addChild(getImageElement("../../../../assets/images/plane.jpg"));                        
            container.addChild(getImageElement("../../../../assets/images/plane.jpg"));                        
            container.addChild(getImageElement("../../../../assets/images/plane.jpg"));                        
            return container;
        }
        
        
        function getImageElement(source:String):Image
        {
            var img:Image = new Image();
            img.open(source);
            img.width = 250;
            img.height = 150;
            img.resample = true;
            return img;
        }
        
     

See also

GridLayout
FanLayout
PileLayout
PointLayout
RandomLayout
com.gestureworks.cml.factories.LayoutFactory
com.gestureworks.cml.element.Container


Public Properties
 PropertyDefined By
 Inheritedalpha : Number
Specifies the alpha value of the display objects in the layout
LayoutFactory
 InheritedcacheTransforms : Boolean
Flag indicating the childTransformations are to be cached and reapplied for convenience.
LayoutFactory
 InheritedcenterColumn : Boolean
Flag indicating the alignment of the objects' centers with the center of the column.
LayoutFactory
 InheritedcenterRow : Boolean
Flag indicating the alignment of the objects' centers with the center of the row.
LayoutFactory
 InheritedcmlIndex : int
sets the index of cml
ObjectFactory
 InheritedcontinuousTransform : Boolean
Flag indicating the application of a transform relative to the current transform.
LayoutFactory
 Inheritedeasing : *
Specifies the easing equation.
LayoutFactory
 Inheritedexclusions : Array
An array of objects to exclude from the layout application
LayoutFactory
 Inheritedid : String
sets the id
ObjectFactory
 InheritedmarginX : Number
LayoutFactory
 InheritedmarginY : Number
Spacing added to the height of an object
LayoutFactory
 InheritedonComplete : Function
Function to call on layout complete
LayoutFactory
 InheritedonUpdate : Function
Function to call on layout update
LayoutFactory
 InheritedoriginX : Number
Starting x coordinate of layout relative to the container
LayoutFactory
 Inherited_originY : Number = 0
LayoutFactory
 InheritedoriginY : Number
Starting y coordinate of layout relative to the container
LayoutFactory
 InheritedpropertyStates : Array
Deprecated: Please Use state
ObjectFactory
 Inheritedrotation : Number
Specifies the rotation value of the display objects in the layout
LayoutFactory
 Inheritedscale : Number
Specifies the scale value of the display objects in the layout
LayoutFactory
 InheritedspacingX : Number
Horizontal distance between the origins of two objects
LayoutFactory
 InheritedspacingY : Number
Vertical distance between the origins of two objects
LayoutFactory
 Inheritedstate : Array
property states array
ObjectFactory
 Inheritedtween : Boolean
Flag indicating the display objects will animate to their layout positions.
LayoutFactory
 InheritedtweenTime : Number
The time(ms) the display objects will take to move into positions
LayoutFactory
 Inheritedtype : String
Specifies a layout subtype
LayoutFactory
 InheriteduseMargins : Boolean
Flag indicating the use of margins or spacing
LayoutFactory
Protected Properties
 PropertyDefined By
 InheritedchildTransformations : Array
LayoutFactory
Public Methods
 MethodDefined By
  
Constructor
ListLayout
 Inherited
clone():*
Returns clone of self
ObjectFactory
  
dispose():void
[override] Disposal function
ListLayout
  
horizontal(container:DisplayObjectContainer):void
Distributes the the children of the container in a list about the x-axis.
ListLayout
 Inherited
killTween(child:* = null):void
Kills the tweening of the provided child.
LayoutFactory
  
layout(container:DisplayObjectContainer):void
[override] Apply layout type to container object Object passed must implement IContainer
ListLayout
 Inherited
parseCML(cml:XMLList):XMLList
parses cml file
ObjectFactory
 Inherited
postparseCML(cml:XMLList):void
postparse method
ObjectFactory
 Inherited
updateProperties(state:Number = 0):void
update the properties
ObjectFactory
  
vertical(container:DisplayObjectContainer):void
Distributes the the children of the container in a vertical list about the y-axis.
ListLayout
Protected Methods
 MethodDefined By
 Inherited
degreesToRadians(degrees:Number):Number
[static] Converts degrees to radians
LayoutFactory
 Inherited
getMatrixObj(mtx:Matrix):Object
[static] Converts transformation matrix to TweenMax syntax
LayoutFactory
 Inherited
getMaxHeight(c:DisplayObjectContainer):Number
[static] Returns the max height of the container's children
LayoutFactory
 Inherited
getMaxWidth(c:DisplayObjectContainer):Number
[static] Returns the max width of the container's children
LayoutFactory
 Inherited
pointRotateMatrix(angle:Number, aroundX:Number, aroundY:Number, m:Matrix = null):Matrix
[static] Returns a matrix rotated around a specific point at a specific angle
LayoutFactory
 Inherited
randomMinMax(min:Number, max:Number):Number
[static] Generates a reandom number between min and max
LayoutFactory
 Inherited
rotateAroundPoint(obj:*, angle:Number, aroundX:Number, aroundY:Number):void
[static] Rotates an object around a spcecific point at a specific angle of rotation
LayoutFactory
 Inherited
rotateTransform(m:Matrix, rot:Number):void
Apply a rotation to the provided transformation matrix
LayoutFactory
 Inherited
scaleTransform(m:Matrix, s:Number):void
Apply a scale to the provided transformation matrix
LayoutFactory
 Inherited
translateTransform(m:Matrix, x:Number, y:Number):void
Apply a translation to the provided transformation matrix
LayoutFactory
 Inherited
validObject(obj:*):Boolean
Determines if an object meets the criteria to be included in the layout
LayoutFactory
Constructor Detail
ListLayout()Constructor
public function ListLayout()

Constructor

Method Detail
dispose()method
override public function dispose():void

Disposal function

horizontal()method 
public function horizontal(container:DisplayObjectContainer):void

Distributes the the children of the container in a list about the x-axis. Margin is multiplied by 2 to represent the margin between two objects.

Parameters

container:DisplayObjectContainer

layout()method 
override public function layout(container:DisplayObjectContainer):void

Apply layout type to container object Object passed must implement IContainer

Parameters

container:DisplayObjectContainer

vertical()method 
public function vertical(container:DisplayObjectContainer):void

Distributes the the children of the container in a vertical list about the y-axis. Margin is multiplied by 2 to represent the margin between two objects.

Parameters

container:DisplayObjectContainer