This class manage all the system of Layers. It has a reference to the main timeline and an array of LayoutLayers objects. This class control de depths for the LayoutLayers and prevent the duplication of Layers. This class also listen to changes of the Stage size.
LayoutLayer, LayoutItem, LayoutOrientation, LayoutPosition, LayoutType
| com. | This class manage all the system of Layers. |
| Variables | |
| _refClip_mc | A reference to the main timeline |
| _layerList_arr | The list of LayoutLayers |
| _depth | A property to control the depths of the LayoutLayers the system will create. |
| _container_mc | The clip where all the LayoutLayers will be created |
| Functions | |
| LayoutManager | Constructor Set the reference to the main timeline, and the depth of clip where all the layers will be created. |
| createLayer | Create a new LayoutLayer in the system with the identifier pass to it. |
| setLayerAlignment | Set the alignment of the Layer named with the identifier passed to this method. |
| setLayerOrientation | Set the orientation of the Layer named with the identifier passed to this method. |
| setLayerSize | Set the size of the Layer named with the identifier passed to this method. |
| setLayerPosition | Set the position of the Layer named with the identifier passed to this method. |
| addItem | Link a new LayoutItem to the Layer named with the identifier passed to this method, via addItem method of tye LayoutLayer |
| existLayer | Search a LayoutLayer in the Layers list named with the value of the idSearched passed to this method |
| onResize | Event triggered when the screen size changes |
public function createLayer( identifier: String ):LayoutLayer
Create a new LayoutLayer in the system with the identifier pass to it. If a Layer exists with this identifier, return undefined.
| identifier | : the new LayoutLayer identifier |
the reference to the new LayoutLayer object
16/09/2007
Marcos
public function setLayerAlignment( identifier: String, mode: String ):Number
Set the alignment of the Layer named with the identifier passed to this method.
| identifier | : the identifier of the Layer that will be changed its alignment |
| mode | : the new alignment for the layer |
1 if the operation was successful, or -1 if not
16/09/2007
Marcos
public function setLayerOrientation( identifier: String, o: String ):Number
Set the orientation of the Layer named with the identifier passed to this method.
| identifier | : the identifier of the Layer that will be changed its orientation |
| 0 | : the new orientation for the layer |
1 if the operation was successful, or -1 if not
16/09/2007
Marcos
public function setLayerSize( identifier: String, typeW: String, typeH: String, w: Number, h: Number ):Number
Set the size of the Layer named with the identifier passed to this method.
| identifier | : the identifier of the Layer that will be changed its size |
| typeW | : the type of the width (relative or absolute) |
| typeH | : the type of the height (relative or absolute) |
| w | : the new width value for the layer |
| h | : the new height value for the layer |
1 if the operation was successful, or -1 if not
16/09/2007
Marcos
public function setLayerPosition( identifier: String, typePX: String, typePY: String, dx: Number, dy: Number ):Number
Set the position of the Layer named with the identifier passed to this method.
| identifier | : the identifier of the Layer that will be changed its position |
| typePX | : the type of the horizontal position |
| typePY | : the type of the vertical position |
| dx | : distance to the reference point in the x axis |
| dy | : distance to the reference point in the y axis |
1 if the operation was successful, or -1 if not
16/09/2007
Marcos
public function addItem( identifier: String, idItem: String, mc: MovieClip, typX: String, typY: String, algn: String, dx: Number, dy: Number, offx: Number, offy: Number, anim: Boolean ):Number
Link a new LayoutItem to the Layer named with the identifier passed to this method, via addItem method of tye LayoutLayer
| identifier | : the identifier of the LayoutLayer that will be associated with the new LayoutItem |
| idItem | : the identifier of the new LayoutItem that will be created and linked to the LayoutLayer named as the idenfifier passed to this method |
| mc | : the reference to the movieclip in the stage, associated to the LayoutItem |
| typX | : the type of the horizontal position |
| typY | : the type of the vertical position |
| algn | : the alignment of the new LayoutItem |
| dx | : distance to the reference point in the x axis |
| dy | : distance to the reference point in the y axis |
| offx | : offset in the x axis of the clip associated to the LayouItem |
| offy | : offset in the y axis of the clip associated to the LayoutItem |
| anim | : boolean value that indicates if the changes are animated or not |
16/09/2007
Marcos
private function existLayer( idSearched: String ):Number
Search a LayoutLayer in the Layers list named with the value of the idSearched passed to this method
| idSearched | : the identifier of the Layer that will be searched in the layers list |
A number with the possition in the layers list, or -1 if is not in the layers list.
16/09/2007
Marcos
A reference to the main timeline
private var _refClip_mc: MovieClip
The list of LayoutLayers
private var _layerList_arr: Array
A property to control the depths of the LayoutLayers the system will create.
private var _depth: Number
The clip where all the LayoutLayers will be created
private var _container_mc: MovieClip
Constructor Set the reference to the main timeline, and the depth of clip where all the layers will be created.
public function LayoutManager( base_mc: MovieClip, d: Number )
Create a new LayoutLayer in the system with the identifier pass to it.
public function createLayer( identifier: String ):LayoutLayer
Set the alignment of the Layer named with the identifier passed to this method.
public function setLayerAlignment( identifier: String, mode: String ):Number
Set the orientation of the Layer named with the identifier passed to this method.
public function setLayerOrientation( identifier: String, o: String ):Number
Set the size of the Layer named with the identifier passed to this method.
public function setLayerSize( identifier: String, typeW: String, typeH: String, w: Number, h: Number ):Number
Set the position of the Layer named with the identifier passed to this method.
public function setLayerPosition( identifier: String, typePX: String, typePY: String, dx: Number, dy: Number ):Number
Link a new LayoutItem to the Layer named with the identifier passed to this method, via addItem method of tye LayoutLayer
public function addItem( identifier: String, idItem: String, mc: MovieClip, typX: String, typY: String, algn: String, dx: Number, dy: Number, offx: Number, offy: Number, anim: Boolean ):Number
Search a LayoutLayer in the Layers list named with the value of the idSearched passed to this method
private function existLayer( idSearched: String ):Number
Event triggered when the screen size changes
public function onResize():Void