Packageardisia.components.viewStack
Classpublic class ViewStack
InheritanceViewStack Inheritance spark.components.SkinnableContainer
Subclasses Accordion, TabPaneNavigator

The ViewStack is a container that only displays one of its child elements at a time. Supports deferred instantiation for MXML content.

Direct child elements must implement IDeferredContentOwner (SkinnableContainer).

The ViewStack's measured dimensions are the same as the selected child's.

View the technical documentation on the Ardisia Labs website for more information.

Default MXML PropertymxmlContentFactory



Public Properties
 PropertyDefined By
  selectedChild : IVisualElement
The selected child element in the ViewStack.
ViewStack
  selectedIndex : int
The zero-based index of the currently visible child element.
ViewStack
Protected Methods
 MethodDefined By
  
commitSelectedIndex(removeFromLayout:Boolean = true):void
Commit the selected index, update the visible element and update the bindings.
ViewStack
  
eventHandler(event:Event):void
Handles events on the class.
ViewStack
  
selectElement(element:IVisualElement):void
Select the following element and initialize if necessary.
ViewStack
  
Setup the deferred content.
ViewStack
Events
 Event Summary Defined By
  Dispatched when the selectedChild changes.ViewStack
  Dispatched when the selectedChild is about to change.ViewStack
Styles
 Style Description Defined By
  
backgroundAlpha
Type: Number CSS Inheritance: no
The alpha of the background. The default value is 1.
ViewStack
  
backgroundColor
Type: uint Format: Color CSS Inheritance: no
The color of the background. The default value is #FFFFFF.
ViewStack
  
borderAlpha
Type: Number CSS Inheritance: no
The alpha of the border. The default value is 1.
ViewStack
  
borderColor
Type: uint Format: Color CSS Inheritance: no
The color of the border. The default value is 0.
ViewStack
  
borderVisible
Type: Boolean CSS Inheritance: no
True to display a border. The default value is false.
ViewStack
Property Detail
selectedChildproperty
selectedChild:IVisualElement

The selected child element in the ViewStack.

A value of null indicates no selection.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get selectedChild():IVisualElement
    public function set selectedChild(value:IVisualElement):void
selectedIndexproperty 
selectedIndex:int

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

a value of -1 indicates no selection.

Is bindable. Bound to "change" events.

The default value is -1.

This property can be used as the source for data binding.


Implementation
    public function get selectedIndex():int
    public function set selectedIndex(value:int):void
Method Detail
commitSelectedIndex()method
protected function commitSelectedIndex(removeFromLayout:Boolean = true):void

Commit the selected index, update the visible element and update the bindings.

Parameters

removeFromLayout:Boolean (default = true) — true to remove elements from layout

eventHandler()method 
protected function eventHandler(event:Event):void

Handles events on the class.

Parameters

event:Event — the Event that triggered the handler

selectElement()method 
protected function selectElement(element:IVisualElement):void

Select the following element and initialize if necessary.

Parameters

element:IVisualElement — the IVisualElement to display

setupDeferredContent()method 
protected function setupDeferredContent():void

Setup the deferred content.

Event Detail
change Event
Event Object Type: spark.events.IndexChangeEvent
IndexChangeEvent.type property = spark.events.IndexChangeEvent

Dispatched when the selectedChild changes.

changing Event  
Event Object Type: spark.events.IndexChangeEvent
IndexChangeEvent.type property = spark.events.IndexChangeEvent

Dispatched when the selectedChild is about to change. Can be cancelled.