com.blocketpc.managers.layoutmanager.LayoutManager

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.

See Also

LayoutLayer, LayoutItem, LayoutOrientation, LayoutPosition, LayoutType

Summary
com.blocketpc.managers.layoutmanager.LayoutManagerThis class manage all the system of Layers.
Variables
_refClip_mcA reference to the main timeline
_layerList_arrThe list of LayoutLayers
_depthA property to control the depths of the LayoutLayers the system will create.
_container_mcThe clip where all the LayoutLayers will be created
Functions
LayoutManagerConstructor Set the reference to the main timeline, and the depth of clip where all the layers will be created.
createLayerCreate a new LayoutLayer in the system with the identifier pass to it.
setLayerAlignmentSet the alignment of the Layer named with the identifier passed to this method.
setLayerOrientationSet the orientation of the Layer named with the identifier passed to this method.
setLayerSizeSet the size of the Layer named with the identifier passed to this method.
setLayerPositionSet the position of the Layer named with the identifier passed to this method.
addItemLink a new LayoutItem to the Layer named with the identifier passed to this method, via addItem method of tye LayoutLayer
existLayerSearch a LayoutLayer in the Layers list named with the value of the idSearched passed to this method
onResizeEvent triggered when the screen size changes

Variables

_refClip_mc

private var _refClip_mc: MovieClip

A reference to the main timeline

_layerList_arr

private var _layerList_arr: Array

The list of LayoutLayers

_depth

private var _depth: Number

A property to control the depths of the LayoutLayers the system will create.

_container_mc

private var _container_mc: MovieClip

The clip where all the LayoutLayers will be created

Functions

LayoutManager

public function LayoutManager(base_mc: MovieClip,
d: Number)

Constructor Set the reference to the main timeline, and the depth of clip where all the layers will be created.

Since

16/09/2007

Author

Marcos

createLayer

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.

Parameters

identifier: the new LayoutLayer identifier

Returns

the reference to the new LayoutLayer object

Since

16/09/2007

Author

Marcos

setLayerAlignment

public function setLayerAlignment(identifier: String,
mode: String):Number

Set the alignment of the Layer named with the identifier passed to this method.

Parameters

identifier: the identifier of the Layer that will be changed its alignment
mode: the new alignment for the layer

Returns

1 if the operation was successful, or -1 if not

Since

16/09/2007

Author

Marcos

setLayerOrientation

public function setLayerOrientation(identifier: String,
o: String):Number

Set the orientation of the Layer named with the identifier passed to this method.

Parameters

identifier: the identifier of the Layer that will be changed its orientation
0: the new orientation for the layer

Returns

1 if the operation was successful, or -1 if not

Since

16/09/2007

Author

Marcos

setLayerSize

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.

Parameters

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

Returns

1 if the operation was successful, or -1 if not

Since

16/09/2007

Author

Marcos

setLayerPosition

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.

Parameters

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

Returns

1 if the operation was successful, or -1 if not

Since

16/09/2007

Author

Marcos

addItem

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

Parameters

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

Since

16/09/2007

Author

Marcos

existLayer

private function existLayer(idSearched: String):Number

Search a LayoutLayer in the Layers list named with the value of the idSearched passed to this method

Parameters

idSearched: the identifier of the Layer that will be searched in the layers list

Returns

A number with the possition in the layers list, or -1 if is not in the layers list. 

Since

16/09/2007

Author

Marcos

onResize

public function onResize():Void

Event triggered when the screen size changes

Since

16/09/2007

Author

Marcos

private var _refClip_mc: MovieClip
A reference to the main timeline
private var _layerList_arr: Array
The list of LayoutLayers
private var _depth: Number
A property to control the depths of the LayoutLayers the system will create.
private var _container_mc: MovieClip
The clip where all the LayoutLayers will be created
public function LayoutManager(base_mc: MovieClip,
d: Number)
Constructor Set the reference to the main timeline, and the depth of clip where all the layers will be created.
public function createLayer(identifier: String):LayoutLayer
Create a new LayoutLayer in the system with the identifier pass to it.
public function setLayerAlignment(identifier: String,
mode: String):Number
Set the alignment of the Layer named with the identifier passed to this method.
public function setLayerOrientation(identifier: String,
o: String):Number
Set the orientation 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 size 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
Set the position of the Layer named with the identifier passed to this method.
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
private function existLayer(idSearched: String):Number
Search a LayoutLayer in the Layers list named with the value of the idSearched passed to this method
public function onResize():Void
Event triggered when the screen size changes
This class represents the layer created to linked LayoutItems to it.
This class control the possition of the linked movieclip relative to the LayoutManager associated with it.
This class stores the different values for the screen orientation.
This class stores the different values for the Layers and Items positions.
This class stores the different values for the type of the position, relative or absolute.