Constructors

Properties

Methods

StageManager class

StageManager

extends EventDispatcher

 

 

Overview

Author

Matt Przybylski [http://www.reintroducing.com]

Version

1.0

Description

Creates an instance of the StageManager that aligns items according to their selected alignment mode. Also dispatches an event, ON_RESIZE, that allows for further manipulation of items to the stage sizing.

Constructors

 

StageManager

Usage

public function StageManager($stage:Stage, $resizeStyle:String, $easeTime:Number, $easeFunc:Function):void

Description

Creates a new instance of the StageManager class.

Parameters

$stage
A reference to the main stage.
$resizeStyle
A string value that represents how to move the clips into position ("easing" or "instant").
$easeTime
If the $resizeStyle is set to "easing", time (in seconds) it takes to ease clips into position.
$easeFunc
If the $resizeStyle is set to "easing", the easing function used to ease clips into position.

Properties

 

items

Usage

public function get items():Array

Description

Returns the current items array.

Methods

 

init

Usage

public function init():void

Description

Initializes the StageManager and helps avoid the FireFox bug (won't manage the stage on initial load).

Returns

void
 

addItem

Usage

public function addItem($item:DisplayObject, $alignMode:String, $offsetX:Number = 0, $offsetY:Number = 0):void

Description

Adds an item to the items array so that is is tracked when resizing. $offsetX and $offsetY are optional and can be left blank to use no offsets.

The $alignMode parameter can be any of the following string values:

  • "TL": top left
  • "TC": top center
  • "TR": top right
  • "ML": middle left
  • "MC": middle center
  • "MR": middle right
  • "BL": bottom left
  • "BC": bottom center
  • "BR": bottom right

Parameters

$item
The item that is to be added to the items array.
$alignMode
A string value that represents the mode to align the item to.
$offsetX
An optional number that represents the value to offset the item on its x axis from its align spot (negative offsets left).
$offsetY
An optional number that represents the value to offset the item on its y axis from its align spot (negative offsets up).

Returns

void
 

removeItem

Usage

public function removeItem($item:DisplayObject):void

Description

Removes an item from the items array so it is no longer tracked by the resizing.

Parameters

$item
The item that is to be removed from the items array.

Returns

void