| Package | gs.managers |
| Class | public final class LayoutManager |
DisplayObjects must have their registration point at 0,0 in order for the align / stage align methods to function correctly. Otherwise you'll see shifts in what is expected.
The LayoutManager can also align objects to inner and outer edges of target display objects.
public class MyClip extends CoreClip
{
public function MyClip()
{
super(); //critical
var mc1:MovieClip = new MovieClip();
//draw vector box in mc1 here...
var mc2:MovieClip = new MovieClip();
//draw vector box in mc2 here...
var mc3:MovieClip = new MovieClip();
//draw vector box in mc3 here...
lm.addChildren(mc1,mc2,mc3); //shortcut to add multiple children.
lm.bringInFront(mc1,mc2); //moves mc1 in front of mc2.
lm.sendToBack(mc1); //sends mc1 all the way to the back.
lm.bringForward(mc2); //brings mc2 forward (in front of mc3).
}
}
Examples are in the guttershark repository.
| Property | Defined by | ||
|---|---|---|---|
| ALIGN_INNER : String = "inner" [static]
An alignment mode that causes the inner edges to be aligned.
| LayoutManager | ||
| ALIGN_OUTER : String = "outer" [static]
An alignment mode that causes the outer edges to be aligned.
| LayoutManager | ||
| ignoreStageAlign : Boolean = true [static]
Ignore the stage align property and correctly translate
stage alignment operations to the actual stage viewport -
meaning if the stage.align property is anything other
than undefined or TOP_LEFT, correctly translate the
positioning offsets that occur when setting x and y.
| LayoutManager | ||
| StageRef : Stage [static]
a reference to the stage
| LayoutManager | ||
| wholePixels : Boolean = true [static]
Whether or not to use whole pixels on for x and y coordinates.
| LayoutManager | ||
| Property | Defined by | ||
|---|---|---|---|
| container : DisplayObjectContainer
The container in which layering operations will occur.
| LayoutManager | ||
| Method | Defined by | ||
|---|---|---|---|
|
LayoutManager(target:DisplayObjectContainer)
Constructor for LayoutManager instances.
| LayoutManager | ||
|
addChildren(... children):void
Add all children specified to the display list.
| LayoutManager | ||
|
addChildrenTo(target:DisplayObjectContainer, ... children):void
Add all children specified onto the display list of the target container.
| LayoutManager | ||
|
alignBottom(alignMode:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the bottom edge of another display object.
| LayoutManager | ||
|
alignBottomCenter(alignMode:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the bottom center of another display object.
| LayoutManager | ||
|
alignBottomLeft(alignModeX:String, alignModeY:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the bottom left corner of another display object.
| LayoutManager | ||
|
alignBottomRight(alignModeX:String, alignModeY:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the bottom right corner of another display object.
| LayoutManager | ||
|
alignCenter(relativeTo:DisplayObject, ... targets):void
Align a display object to the dead center of another display object.
| LayoutManager | ||
|
alignColumn(options:Object, ... objs):void
Align any objects in a vertical stack (column) on y.
| LayoutManager | ||
|
alignLeft(alignMode:String, relativeTo:DisplayObject, ... targets):void
Align the target display object to the left edge of another display object.
| LayoutManager | ||
|
alignMiddleLeft(alignMode:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the left middle of another display object.
| LayoutManager | ||
|
alignMiddleRight(alignMode:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the right middle of another display object.
| LayoutManager | ||
|
alignRight(alignMode:String, relativeTo:DisplayObject, ... targets):void
Align the target display object to the right edge of another display object.
| LayoutManager | ||
|
alignTop(alignMode:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the top edge of another display object.
| LayoutManager | ||
|
alignTopCenter(alignMode:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the top center of another display object.
| LayoutManager | ||
|
alignTopLeft(alignModeX:String, alignModeY:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the top left corner of another display object.
| LayoutManager | ||
|
alignTopRight(alignModeX:String, alignModeY:String, relativeTo:DisplayObject, ... targets):void
Align a display object to the top right corner of another display object.
| LayoutManager | ||
|
alignXCenter(relativeTo:DisplayObject, ... targets):void
Align the target display object centered on the x coordinate relatively
to another display object.
| LayoutManager | ||
|
alignYCenter(relativeTo:DisplayObject, ... targets):void
Align the target display object centered on the y coordinate relatively
to another display object.
| LayoutManager | ||
|
bringForward(target:DisplayObject):void
Bring a display object forward 1 layer.
| LayoutManager | ||
|
bringInFront(target:DisplayObject, relativeTo:DisplayObject):void
Bring a target display object in front of another display object.
| LayoutManager | ||
|
bringToFront(target:DisplayObject):void
Bring the target display object to the top most layer.
| LayoutManager | ||
|
dispose():void
Dispose of this layout manager.
| LayoutManager | ||
|
getAllChildren(target:Sprite):Array
Returns an array of all the children on the targets
display list.
| LayoutManager | ||
|
getStageDeadCenterPoint():Point
Returns the stage dead center point.
| LayoutManager | ||
|
removeAllChildren():void
Remove all children from the display list.
| LayoutManager | ||
|
removeAllChildrenFrom(target:DisplayObjectContainer):void
Remove all children from the display list of the specified target object.
| LayoutManager | ||
|
removeChildren(... children):void
Remove all children specified from the display list.
| LayoutManager | ||
|
removeChildrenFrom(target:DisplayObjectContainer, ... children):void
Remove specified children from the target DisplayObjectContainer's display list.
| LayoutManager | ||
|
sendBackward(target:DisplayObject):void
Send the target display object backward 1 layer.
| LayoutManager | ||
|
sendBehind(target:DisplayObject, relativeTo:DisplayObject):void
Send a target display object behind another display object.
| LayoutManager | ||
|
sendToBack(target:DisplayObject):void
Send the target display object to bottom most layer.
| LayoutManager | ||
|
SetStageReference(st:Stage):void
[static]
Set a reference to the stage.
| LayoutManager | ||
|
stageAlignBottom(alignMode:String, ... targets):void
Align the target display object to the bottom edge of the stage.
| LayoutManager | ||
|
stageAlignBottomCenter(alignMode:String, ... targets):void
Align the target display object to the bottom center of the stage.
| LayoutManager | ||
|
stageAlignBottomLeft(alignModeX:String, alignModeY:String, ... targets):void
Align the target display object to the bottom left corner of the stage.
| LayoutManager | ||
|
stageAlignBottomRight(alignModeX:String, alignModeY:String, ... targets):void
Align the target display object to the bottom right corner of the stage.
| LayoutManager | ||
|
stageAlignCenter(... targets):void
Align the target display object to the dead center of the stage.
| LayoutManager | ||
|
stageAlignLeft(alignMode:String, ... targets):void
Align the target display object to the left edge of the stage.
| LayoutManager | ||
|
stageAlignMiddleLeft(alignMode:String, ... targets):void
Align the target display object to the left middle of the stage.
| LayoutManager | ||
|
stageAlignMiddleRight(alignMode:String, ... targets):void
Align the target display object to the right middle of the stage.
| LayoutManager | ||
|
stageAlignRight(alignMode:String, ... targets):void
Align the target display object to the right edge of the stage.
| LayoutManager | ||
|
stageAlignTop(alignMode:String, ... targets):void
Align the target display object to the top edge of the stage.
| LayoutManager | ||
|
stageAlignTopCenter(alignMode:String, ... targets):void
Align the target display object to the top center of the stage.
| LayoutManager | ||
|
stageAlignTopLeft(alignModeX:String, alignModeY:String, ... targets):void
Align the target display object to the top left corner of the stage.
| LayoutManager | ||
|
stageAlignTopRight(alignModeX:String, alignModeY:String, ... targets):void
Align the target display object to the top right corner of the stage.
| LayoutManager | ||
|
stageAlignXCenter(... targets):void
Align the target display object centered on the x coordinate relatively
to the stage.
| LayoutManager | ||
|
stageAlignYCenter(... targets):void
Align the target display object centered on the y coordinate relatively
to the stage.
| LayoutManager | ||
| ALIGN_INNER | property |
public static var ALIGN_INNER:String = "inner"An alignment mode that causes the inner edges to be aligned.
| ALIGN_OUTER | property |
public static var ALIGN_OUTER:String = "outer"An alignment mode that causes the outer edges to be aligned.
| container | property |
protected var container:DisplayObjectContainerThe container in which layering operations will occur.
| ignoreStageAlign | property |
public static var ignoreStageAlign:Boolean = trueIgnore the stage align property and correctly translate stage alignment operations to the actual stage viewport - meaning if the stage.align property is anything other than undefined or TOP_LEFT, correctly translate the positioning offsets that occur when setting x and y.
| StageRef | property |
public static var StageRef:Stagea reference to the stage
| wholePixels | property |
public static var wholePixels:Boolean = trueWhether or not to use whole pixels on for x and y coordinates.
| LayoutManager | () | constructor |
public function LayoutManager(target:DisplayObjectContainer)Constructor for LayoutManager instances.
Parameterstarget:DisplayObjectContainer |
| addChildren | () | method |
public function addChildren(... children):voidAdd all children specified to the display list.
Parameters... children — An array of display objects to add.
|
| addChildrenTo | () | method |
public function addChildrenTo(target:DisplayObjectContainer, ... children):voidAdd all children specified onto the display list of the target container.
Parameterstarget:DisplayObjectContainer — A display object to add the spefified children onto.
|
|
... children — An array of display objects to add.
|
| alignBottom | () | method |
public function alignBottom(alignMode:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the bottom edge of another display object.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| alignBottomCenter | () | method |
public function alignBottomCenter(alignMode:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the bottom center of another display object.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| alignBottomLeft | () | method |
public function alignBottomLeft(alignModeX:String, alignModeY:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the bottom left corner of another display object.
ParametersalignModeX:String — x-Axis alignment: inner or outer (default: inner).
|
|
alignModeY:String — y-Axis alignment: inner or outer (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| alignBottomRight | () | method |
public function alignBottomRight(alignModeX:String, alignModeY:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the bottom right corner of another display object.
ParametersalignModeX:String — x-Axis alignment: inner or outer (default: inner).
|
|
alignModeY:String — y-Axis alignment: inner or outer (default: inner).
|
|
relativeTo:DisplayObject — The target display object to align.
|
|
... targets — The target display object that target will be aligned to.
|
| alignCenter | () | method |
public function alignCenter(relativeTo:DisplayObject, ... targets):voidAlign a display object to the dead center of another display object.
ParametersrelativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| alignColumn | () | method |
public function alignColumn(options:Object, ... objs):voidAlign any objects in a vertical stack (column) on y.
You can supply these options:
options:Object — An object with properties (see above).
|
|
... objs — Rest style list of objects.
|
| alignLeft | () | method |
public function alignLeft(alignMode:String, relativeTo:DisplayObject, ... targets):voidAlign the target display object to the left edge of another display object.
ParametersalignMode:String — Inner or outer align (default: inner)
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display object to align.
|
| alignMiddleLeft | () | method |
public function alignMiddleLeft(alignMode:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the left middle of another display object.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| alignMiddleRight | () | method |
public function alignMiddleRight(alignMode:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the right middle of another display object.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| alignRight | () | method |
public function alignRight(alignMode:String, relativeTo:DisplayObject, ... targets):voidAlign the target display object to the right edge of another display object.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display object to align.
|
| alignTop | () | method |
public function alignTop(alignMode:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the top edge of another display object.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display object to align.
|
| alignTopCenter | () | method |
public function alignTopCenter(alignMode:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the top center of another display object.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| alignTopLeft | () | method |
public function alignTopLeft(alignModeX:String, alignModeY:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the top left corner of another display object.
ParametersalignModeX:String — x-Axis alignment: inner or outer (default: inner).
|
|
alignModeY:String — y-Axis alignment: inner or outer (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| alignTopRight | () | method |
public function alignTopRight(alignModeX:String, alignModeY:String, relativeTo:DisplayObject, ... targets):voidAlign a display object to the top right corner of another display object.
ParametersalignModeX:String — x-Axis alignment: inner or outer (default: inner).
|
|
alignModeY:String — y-Axis alignment: inner or outer (default: inner).
|
|
relativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| alignXCenter | () | method |
public function alignXCenter(relativeTo:DisplayObject, ... targets):voidAlign the target display object centered on the x coordinate relatively to another display object.
ParametersrelativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display object to align.
|
| alignYCenter | () | method |
public function alignYCenter(relativeTo:DisplayObject, ... targets):voidAlign the target display object centered on the y coordinate relatively to another display object.
ParametersrelativeTo:DisplayObject — The target display object that target will be aligned to.
|
|
... targets — The target display objects to align.
|
| bringForward | () | method |
public function bringForward(target:DisplayObject):voidBring a display object forward 1 layer.
Parameterstarget:DisplayObject — The target display object.
|
| bringInFront | () | method |
public function bringInFront(target:DisplayObject, relativeTo:DisplayObject):voidBring a target display object in front of another display object.
Parameterstarget:DisplayObject — The target display object to re-layer.
|
|
relativeTo:DisplayObject — The display object in which the target will be brought in front of.
|
| bringToFront | () | method |
public function bringToFront(target:DisplayObject):voidBring the target display object to the top most layer.
Parameterstarget:DisplayObject — The target display object.
|
| dispose | () | method |
public function dispose():voidDispose of this layout manager.
| getAllChildren | () | method |
public function getAllChildren(target:Sprite):ArrayReturns an array of all the children on the targets display list.
Parameterstarget:Sprite — The target display object.
|
Array |
| getStageDeadCenterPoint | () | method |
public function getStageDeadCenterPoint():PointReturns the stage dead center point.
ReturnsPoint |
| removeAllChildren | () | method |
public function removeAllChildren():voidRemove all children from the display list.
| removeAllChildrenFrom | () | method |
public function removeAllChildrenFrom(target:DisplayObjectContainer):voidRemove all children from the display list of the specified target object.
Parameterstarget:DisplayObjectContainer — The target display object container whose children will be removed.
|
| removeChildren | () | method |
public function removeChildren(... children):voidRemove all children specified from the display list.
Parameters... children — The children to remove.
|
| removeChildrenFrom | () | method |
public function removeChildrenFrom(target:DisplayObjectContainer, ... children):voidRemove specified children from the target DisplayObjectContainer's display list.
Parameterstarget:DisplayObjectContainer — A display object to remove the spefified children from.
|
|
... children — The children to remove.
|
| sendBackward | () | method |
public function sendBackward(target:DisplayObject):voidSend the target display object backward 1 layer.
Parameterstarget:DisplayObject — The target display object.
|
| sendBehind | () | method |
public function sendBehind(target:DisplayObject, relativeTo:DisplayObject):voidSend a target display object behind another display object.
Parameterstarget:DisplayObject — The target display object to re-layer.
|
|
relativeTo:DisplayObject — The display object in which the target will be moved behind.
|
| sendToBack | () | method |
public function sendToBack(target:DisplayObject):voidSend the target display object to bottom most layer.
Parameterstarget:DisplayObject — The target display object.
|
| SetStageReference | () | method |
public static function SetStageReference(st:Stage):voidSet a reference to the stage.
Parametersst:Stage — The stage instance.
|
| stageAlignBottom | () | method |
public function stageAlignBottom(alignMode:String, ... targets):voidAlign the target display object to the bottom edge of the stage.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignBottomCenter | () | method |
public function stageAlignBottomCenter(alignMode:String, ... targets):voidAlign the target display object to the bottom center of the stage.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignBottomLeft | () | method |
public function stageAlignBottomLeft(alignModeX:String, alignModeY:String, ... targets):voidAlign the target display object to the bottom left corner of the stage.
ParametersalignModeX:String — x-Axis alignment: inner or outer (default: inner).
|
|
alignModeY:String — y-Axis alignment: inner or outer (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignBottomRight | () | method |
public function stageAlignBottomRight(alignModeX:String, alignModeY:String, ... targets):voidAlign the target display object to the bottom right corner of the stage.
ParametersalignModeX:String — x-Axis alignment: inner or outer (default: inner).
|
|
alignModeY:String — y-Axis alignment: inner or outer (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignCenter | () | method |
public function stageAlignCenter(... targets):voidAlign the target display object to the dead center of the stage.
Parameters... targets — The target display objects to align.
|
| stageAlignLeft | () | method |
public function stageAlignLeft(alignMode:String, ... targets):voidAlign the target display object to the left edge of the stage.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignMiddleLeft | () | method |
public function stageAlignMiddleLeft(alignMode:String, ... targets):voidAlign the target display object to the left middle of the stage.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignMiddleRight | () | method |
public function stageAlignMiddleRight(alignMode:String, ... targets):voidAlign the target display object to the right middle of the stage.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignRight | () | method |
public function stageAlignRight(alignMode:String, ... targets):voidAlign the target display object to the right edge of the stage.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignTop | () | method |
public function stageAlignTop(alignMode:String, ... targets):voidAlign the target display object to the top edge of the stage.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignTopCenter | () | method |
public function stageAlignTopCenter(alignMode:String, ... targets):voidAlign the target display object to the top center of the stage.
ParametersalignMode:String — Inner or outer align (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignTopLeft | () | method |
public function stageAlignTopLeft(alignModeX:String, alignModeY:String, ... targets):voidAlign the target display object to the top left corner of the stage.
ParametersalignModeX:String — The target display object to align.
|
|
alignModeY:String — x-Axis alignment: inner or outer (default: inner).
|
|
... targets — y-Axis alignment: inner or outer (default: inner).
|
| stageAlignTopRight | () | method |
public function stageAlignTopRight(alignModeX:String, alignModeY:String, ... targets):voidAlign the target display object to the top right corner of the stage.
ParametersalignModeX:String — x-Axis alignment: inner or outer (default: inner).
|
|
alignModeY:String — y-Axis alignment: inner or outer (default: inner).
|
|
... targets — The target display objects to align.
|
| stageAlignXCenter | () | method |
public function stageAlignXCenter(... targets):voidAlign the target display object centered on the x coordinate relatively to the stage.
Parameters... targets — The target display objects to align.
|
| stageAlignYCenter | () | method |
public function stageAlignYCenter(... targets):voidAlign the target display object centered on the y coordinate relatively to the stage.
Parameters... targets — The target display objects to align.
|