PositionManager

Kind of class:class
Inherits from:CoreObject
Version:04/06/07
Author:Aaron Clinger
Classpath:org.casaframework.layout.PositionManager
File last modified:Sunday, 19 August 2007, 13:43:33
Gives the ablility to position and size MovieClips, TextFields and Buttons with either an external CSS file or an internal StyleSheet object.
Since:
Flash Player 7
Example:
var positionManager:PositionManager = new PositionManager();

this.positionManager.setStyleSheet(this.styleSheet);

this.positionManager.addItem(this.text_txt);
this.positionManager.addItem(this.button_btn);
this.positionManager.addItem(this.movie_mc, {left:"0", height:"100%"});
this.positionManager.positionItems();
See also:
"For information on which CSS properties are supported by PositionManager see org.casaframework.util.StyleSheetUtil.positionItemWithStyleObject."

Summary

Constructor
Instance properties
Instance properties inherited from CoreObject

Constructor

PositionManager

function PositionManager ()
Creates a new PositionManager instance.

Instance methods

addItem

function addItem (item:Object, style:Object) : Boolean
Adds item to be positioned and sized by styles.
Parameters:
item :
A MovieClip, TextField or Button.
style:
[optional] An object with style properties defined. Any properties defined here overwrite the values of any identical properties that may have been defined by setStyleSheet.
Returns:
Returns true if item was of type MovieClip, TextField or Button and was successfully added; otherwise false.
Example:
this.positionManager.addItem(this.movie_mc, {left:"0", height:"100%"}); or this.positionManager.addItem(this.movie_mc, this.styleSheet.getStyle("styleName"));
See also:
"For information on which CSS properties are supported by PositionManager see org.casaframework.util.StyleSheetUtil.positionItemWithStyleObject."

positionItems

function positionItems () : Void
Positions all items added with addItem with the defined styles.
Usage note:
positionItems is automatically called after setStyleSheet.

removeItem

function removeItem (item:Object) : Boolean
Removes item previously added with addItem from receiving style and position updates from PositionManager. Leaves item at its current size and position.
Parameters:
item:
A MovieClip, TextField or Button you wish to remove.
Returns:
Returns true if item was successfully found and removed; otherwise false.

setStyleSheet

function setStyleSheet (style:StyleSheet) : Void
Defines a global stylesheet.

Class maps style IDs to instance names of added items. Style #square_mc { width: 200px; height: 200px; } would apply to an item with an instance name of "square_mc.
Parameters:
style:
A StyleSheet to apply to added items.
See also:
"For information on which CSS properties are supported by PositionManager see org.casaframework.util.StyleSheetUtil.positionItemWithStyleObject."