| Package | com.gestureworks.cml.layouts |
| Class | public class FanLayout |
| Inheritance | FanLayout LayoutFactory ObjectFactory flash.events.EventDispatcher |
var topLeftFan:Container = getImageContainer();
topLeftFan.applyLayout(getFanLayout());
addChild(topLeftFan);
function getImageContainer():Container
{
var container:Container = new Container();
container.addChild(getImageElement("plane.jpg));
container.addChild(getImageElement("plane.jpg));
container.addChild(getImageElement("plane.jpg));
container.addChild(getImageElement("plane.jpg));
container.addChild(getImageElement("plane.jpg));
container.addChild(getImageElement("plane.jpg));
container.addChild(getImageElement("plane.jpg));
container.addChild(getImageElement("plane.jpg));
return container;
}
function getFanLayout(angle:Number = 10, type:String = "topLeftOrigin"):FanLayout
{
var fanLayout:FanLayout = new FanLayout();
fanLayout.angle = angle;
fanLayout.type = type;
fanLayout.tween = true;
fanLayout.tweenTime = 1500;
return fanLayout;
}
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
| Property | Defined By | ||
|---|---|---|---|
![]() | alpha : Number
Specifies the alpha value of the display objects in the layout
| LayoutFactory | |
| angle : Number | FanLayout | ||
![]() | cacheTransforms : Boolean
Flag indicating the childTransformations are to be cached and reapplied for convenience. | LayoutFactory | |
![]() | centerColumn : Boolean
Flag indicating the alignment of the objects' centers with the center of the column. | LayoutFactory | |
![]() | centerRow : Boolean
Flag indicating the alignment of the objects' centers with the center of the row. | LayoutFactory | |
![]() | cmlIndex : int
sets the index of cml
| ObjectFactory | |
![]() | continuousTransform : Boolean
Flag indicating the application of a transform relative to the current transform. | LayoutFactory | |
![]() | easing : *
Specifies the easing equation. | LayoutFactory | |
![]() | exclusions : Array
An array of objects to exclude from the layout application
| LayoutFactory | |
![]() | id : String
sets the id
| ObjectFactory | |
![]() | marginX : Number | LayoutFactory | |
![]() | marginY : Number
Spacing added to the height of an object
| LayoutFactory | |
![]() | onComplete : Function
Function to call on layout complete
| LayoutFactory | |
![]() | onUpdate : Function
Function to call on layout update
| LayoutFactory | |
![]() | originX : Number
Starting x coordinate of layout relative to the container
| LayoutFactory | |
![]() | _originY : Number = 0 | LayoutFactory | |
![]() | originY : Number
Starting y coordinate of layout relative to the container
| LayoutFactory | |
![]() | propertyStates : Array Deprecated: Please Use state | ObjectFactory | |
| rotation : Number [override]
Since this is a rotation dependent layout, override the rotation mutator to prevent conflicts. | FanLayout | ||
![]() | scale : Number
Specifies the scale value of the display objects in the layout
| LayoutFactory | |
![]() | spacingX : Number
Horizontal distance between the origins of two objects
| LayoutFactory | |
![]() | spacingY : Number
Vertical distance between the origins of two objects
| LayoutFactory | |
![]() | state : Array
property states array
| ObjectFactory | |
![]() | tween : Boolean
Flag indicating the display objects will animate to their layout positions. | LayoutFactory | |
![]() | tweenTime : Number
The time(ms) the display objects will take to move into positions
| LayoutFactory | |
![]() | type : String
Specifies a layout subtype
| LayoutFactory | |
![]() | useMargins : Boolean
Flag indicating the use of margins or spacing
| LayoutFactory | |
| Method | Defined By | ||
|---|---|---|---|
Constructor
| FanLayout | ||
![]() | clone():*
Returns clone of self
| ObjectFactory | |
dispose():void [override]
Disposal function
| FanLayout | ||
![]() | killTween(child:* = null):void
Kills the tweening of the provided child. | LayoutFactory | |
layout(container:DisplayObjectContainer):void [override]
Positions and rotates the objects based on the type
| FanLayout | ||
![]() | parseCML(cml:XMLList):XMLList
parses cml file
| ObjectFactory | |
![]() | postparseCML(cml:XMLList):void
postparse method
| ObjectFactory | |
![]() | updateProperties(state:Number = 0):void
update the properties
| ObjectFactory | |
| angle | property |
angle:Number public function get angle():Number public function set angle(value:Number):void| rotation | property |
rotation:Number[override] Since this is a rotation dependent layout, override the rotation mutator to prevent conflicts.
public function get rotation():Number public function set rotation(value:Number):void| FanLayout | () | Constructor |
public function FanLayout()Constructor
| dispose | () | method |
override public function dispose():voidDisposal function
| layout | () | method |
override public function layout(container:DisplayObjectContainer):voidPositions and rotates the objects based on the type
Parameters
container:DisplayObjectContainer |