Packageorg.axiis.states
Classpublic class State
InheritanceState Inheritance Object

States describe modifications to properties that should occur as a result of an event and provides a mechanicsm to make and undo those changes. A State uses three parallel Arrays -- targets, properties, and values -- to define these modifications. For example, this declaration
	                 
	 <axiis:State id="myState"
	 	enterStateEvent="mouseOver"
	 	exitStateEvent="mouseOut"
	 	targets="{[myTarget1,myTarget1,myTarget2]}"
	 	properties="{['width','height','radius']}"
	 	values="{[w,h,r]}" />
	 
	              
indicates that myTarget1.width and myTarget1.height should be set to w and h, respectively and myTarget2.radius should be set to r when the owner of this state is moused over. These values should be unset when the mouse is moved off of the owner.

Within Axiis, an Array of States can be set to any Layout's states property. As Layouts create children, each child sets up listeners on itself for the Layout's states' enterStateEvent and exitStateEvent events. When those events are triggered, the relevant state's apply and remove methods are called, respectively. This is usually used to modify the drawingGeometry of the Layout.



Public Properties
 PropertyDefined By
  enabled : Boolean = true
State
  enterStateEvent : String
The eventType of the Event indicating that this state should be activated.
State
  exitStateEvent : String
The eventType of the Event indicating that this state should be removed.
State
  propagateToAncestors : Boolean = false
A flag indicating that when an AxiisSprite enters this state all of its AxiisSprite ancestors should enter the state as well.
State
  propagateToAncestorsSiblings : Boolean = false
A flag indicating that when an AxiisSprite enters this state all of its AxiisSprite ancestors and their children should enter the state as well.
State
  propagateToDescendents : Boolean = true
A flag indicating that when an AxiisSprite enters this state all of its descendents should enter the state as well.
State
  propagateToSiblings : Boolean = false
A flag indicating that when an AxiisSprite enters this state all of its siblings should enter the state as well.
State
  properties : Array
An Array of Strings that define the properties on the corresponding Objects in the targets Array that should be modified.
State
  targets : Array
An Array of Objects that should have one or more of their properties modified by this state.
State
  values : Array
An Array containing the values that the corresponding target's properties should be set to when this State is applied.
State
Public Methods
 MethodDefined By
  
Constructor.
State
  
apply():void
Modifies each Object at index i in the targets Array by setting its corresponding property, properties[i], to value[i].
State
  
remove():void
Returns the targets' properties to their original values, undoing the effects of the previous call to apply.
State
Property Detail
enabledproperty
public var enabled:Boolean = true

enterStateEventproperty 
public var enterStateEvent:String

The eventType of the Event indicating that this state should be activated.

exitStateEventproperty 
public var exitStateEvent:String

The eventType of the Event indicating that this state should be removed.

propagateToAncestorsproperty 
public var propagateToAncestors:Boolean = false

A flag indicating that when an AxiisSprite enters this state all of its AxiisSprite ancestors should enter the state as well.

propagateToAncestorsSiblingsproperty 
public var propagateToAncestorsSiblings:Boolean = false

A flag indicating that when an AxiisSprite enters this state all of its AxiisSprite ancestors and their children should enter the state as well.

propagateToDescendentsproperty 
public var propagateToDescendents:Boolean = true

A flag indicating that when an AxiisSprite enters this state all of its descendents should enter the state as well.

propagateToSiblingsproperty 
public var propagateToSiblings:Boolean = false

A flag indicating that when an AxiisSprite enters this state all of its siblings should enter the state as well.

propertiesproperty 
public var properties:Array

An Array of Strings that define the properties on the corresponding Objects in the targets Array that should be modified.

targetsproperty 
public var targets:Array

An Array of Objects that should have one or more of their properties modified by this state.

valuesproperty 
public var values:Array

An Array containing the values that the corresponding target's properties should be set to when this State is applied.

Constructor Detail
State()Constructor
public function State()

Constructor.

Method Detail
apply()method
public function apply():void

Modifies each Object at index i in the targets Array by setting its corresponding property, properties[i], to value[i].

In pseudo-code, this amounts to targets[i][properties[i]] = values[i]; for all i.

remove()method 
public function remove():void

Returns the targets' properties to their original values, undoing the effects of the previous call to apply.