Package | com.gestureworks.cml.layouts |
Class | public class ListLayout |
Inheritance | ListLayout ![]() ![]() ![]() |
//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
Method | Defined By | ||
---|---|---|---|
Constructor
| ListLayout | ||
![]() | 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 | ||
![]() | 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 | ||
![]() | parseCML(cml:XMLList):XMLList
parses cml file
| ObjectFactory | |
![]() | postparseCML(cml:XMLList):void
postparse method
| ObjectFactory | |
![]() | 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 |
ListLayout | () | Constructor |
public function ListLayout()
Constructor
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 |