Packagecom.rubenswieringa.containers
Classpublic class SuperViewStack
InheritanceSuperViewStack Inheritance mx.containers.Canvas

SuperViewStack in many ways behaves like the classic ViewStack. Additional features are reversed indexing (0=top, N=bottom) and fading of children.

See also

edit 3 Before modifying and/or redistributing this class, please contact Ruben Swieringa (ruben.swieringa


Public Properties
 PropertyDefined by
  behavior : String
Behavior of this SuperViewStack.
SuperViewStack
  fade : Number
Degree to which a child should be faded if it's underneath another visible child.
SuperViewStack
  fadeColor : uint
Color with which to fade a child, defaults to white (0xFFFFFF).
SuperViewStack
  selectedChild : Container
A reference to the currently visible child container.
SuperViewStack
  selectedIndex : uint
The zero-based index of the currently visible child container.
SuperViewStack
Public Methods
 MethodDefined by
  
Constructor.
SuperViewStack
  
addChild(child:DisplayObject):DisplayObject
Adds a child DisplayObject instance to this DisplayObjectContainer instance.
SuperViewStack
  
addChildAt(child:DisplayObject, index:int):DisplayObject
Adds a child DisplayObject to this Container.
SuperViewStack
  
getChildAt(index:int):DisplayObject
Returns the child display object instance that exists at the specified index.
SuperViewStack
  
getChildIndex(child:DisplayObject):int
Returns the index position of a child DisplayObject instance.
SuperViewStack
  
Removes all children from the child list of this container.
SuperViewStack
  
removeChild(child:DisplayObject):DisplayObject
Removes a child DisplayObject from the child list of this Container.
SuperViewStack
  
removeChildAt(index:int):DisplayObject
Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.
SuperViewStack
  
setChildIndex(child:DisplayObject, index:int):void
Changes the position of an existing child in the display object container.
SuperViewStack
  
swapChildrenAt(index1:int, index2:int):void
Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.
SuperViewStack
Events
 EventSummaryDefined by
   Dispatched when the selected child Container changes.SuperViewStack
Public Constants
 ConstantDefined by
  BEHAVIOR_CHANGED : String = "Behavior of SuperViewStack changed"
[static] Event type for the Event that is dispatched when the selected child Container changes.
SuperViewStack
  FADESHAPE_NAME : String = "superviewstackfade"
[static] Name of the Shape that is used to simulate fading of Containers.
SuperViewStack
  NORMAL : String = "ViewStack"
[static] Normal behavior mode, simulating the behavior of the classic ViewStack
SuperViewStack
  SUPER : String = "SuperViewStack"
[static] Full-feature SuperViewStack behavior mode
SuperViewStack
Property detail
behaviorproperty
behavior:String  [read-write]

Behavior of this SuperViewStack. Can be adjusted during runtime. Values can be either SuperViewStack.SUPER or SuperViewStack.NORMAL. If normal, the SuperViewStack will act like the classic ViewStack.

Implementation
    public function get behavior():String
    public function set behavior(value:String):void

See also

fadeproperty 
fade:Number  [read-write]

Degree to which a child should be faded if it's underneath another visible child. Values range from 0.0 (completely transparent) to 1.0 (no transparency), defaults to 0.6.

Implementation
    public function get fade():Number
    public function set fade(value:Number):void
fadeColorproperty 
fadeColor:uint  [read-write]

Color with which to fade a child, defaults to white (0xFFFFFF).

Implementation
    public function get fadeColor():uint
    public function set fadeColor(value:uint):void
selectedChildproperty 
selectedChild:Container  [read-write]

A reference to the currently visible child container.

Implementation
    public function get selectedChild():Container
    public function set selectedChild(value:Container):void

See also

selectedIndexproperty 
selectedIndex:uint  [read-write]

The zero-based index of the currently visible child container.

Implementation
    public function get selectedIndex():uint
    public function set selectedIndex(value:uint):void

See also

Constructor detail
SuperViewStack()constructor
public function SuperViewStack()

Constructor.

Method detail
addChild()method
public override function addChild(child:DisplayObject):DisplayObject

Adds a child DisplayObject instance to this DisplayObjectContainer instance. Adjusted to make sure that (if reverse is set to true) children are created from top to bottom.

Parameters
child:DisplayObject — The DisplayObject to add as a child of this Container.

Returns
DisplayObject — The added child as an object of type DisplayObject.

See also

addChildAt()method 
public override function addChildAt(child:DisplayObject, index:int):DisplayObject

Adds a child DisplayObject to this Container. The child is added at the index specified. Adjusted to make sure that (if reverse is set to true) children are created from top to bottom.

Parameters
child:DisplayObject — The DisplayObject to add as a child of this Container.
 
index:int — The index to add the child at.

Returns
DisplayObject — The added child as an object of type DisplayObject.

See also

getChildAt()method 
public override function getChildAt(index:int):DisplayObject

Returns the child display object instance that exists at the specified index.

Parameters
index:int — The index position of the child object.

Returns
DisplayObject — The child display object at the specified index position.

See also

getChildIndex()method 
public override function getChildIndex(child:DisplayObject):int

Returns the index position of a child DisplayObject instance.

Parameters
child:DisplayObject — The DisplayObject instance to identify.

Returns
int — The index position of the child display object to identify.

See also

removeAllChildren()method 
public override function removeAllChildren():void

Removes all children from the child list of this container.

See also

removeChild()method 
public override function removeChild(child:DisplayObject):DisplayObject

Removes a child DisplayObject from the child list of this Container.

Parameters
child:DisplayObject — The DisplayObject to remove.

Returns
DisplayObject — The DisplayObject instance that was removed.

See also

removeChildAt()method 
public override function removeChildAt(index:int):DisplayObject

Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.

Parameters
index:int — The child index of the DisplayObject to remove.

Returns
DisplayObject — The DisplayObject instance that was removed.

See also

setChildIndex()method 
public override function setChildIndex(child:DisplayObject, index:int):void

Changes the position of an existing child in the display object container.

Parameters
child:DisplayObject — The child DisplayObject instance for which you want to change the index number.
 
index:int — The resulting index number for the child display object.

See also

swapChildrenAt()method 
public override function swapChildrenAt(index1:int, index2:int):void

Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child list.

Parameters
index1:int — The index position of the first child object.
 
index2:int — The index position of the second child object.

See also

Event detail
changeevent 
Event object type: mx.events.IndexChangedEvent

Dispatched when the selected child Container changes.

Constant detail
BEHAVIOR_CHANGEDconstant
public static const BEHAVIOR_CHANGED:String = "Behavior of SuperViewStack changed"

Event type for the Event that is dispatched when the selected child Container changes.

See also

FADESHAPE_NAMEconstant 
public static const FADESHAPE_NAME:String = "superviewstackfade"

Name of the Shape that is used to simulate fading of Containers.

NORMALconstant 
public static const NORMAL:String = "ViewStack"

Normal behavior mode, simulating the behavior of the classic ViewStack

See also

SUPERconstant 
public static const SUPER:String = "SuperViewStack"

Full-feature SuperViewStack behavior mode

See also