Packageat.utils
Classpublic class StateUtils



Public Methods
 MethodDefined by
  
getNextState(uiComponent:UIComponent, stateName:String = null):State
[static] Given a state in the specified UIComponent, returns the next state in the UIComponent's state array.
StateUtils
  
getStateByName(uiComponent:UIComponent, stateName:String):State
[static] Returns the given UIComponent's State object associated with the specified state name.
StateUtils
  
getStateIndex(uiComponent:UIComponent, stateName:String):int
[static] Returns the index of the specified State in the given UIComponent.
StateUtils
  
isBasedOn(uiComponent:UIComponent, baseStateName:String, proposedChildStateName:String, allowIdentity:Boolean = true):Boolean
[static] Determines if one state is based upon another.
StateUtils
  
isLeavingState(uiComponent:UIComponent, state:String, oldState:String, newState:String, checkAncestors:Boolean = true):Boolean
[static] Determines if the given UIComponent is leaving the specified state, or any decendant of that state (i.e.
StateUtils
Method detail
getNextState()method
public static function getNextState(uiComponent:UIComponent, stateName:String = null):State

Given a state in the specified UIComponent, returns the next state in the UIComponent's state array.

Parameters
uiComponent:UIComponent — The component to check for the given states
 
stateName:String (default = null) — name of the state whom which to find the next state in the state array

Returns
State — The next State object in the given UIComponent's state array.
getStateByName()method 
public static function getStateByName(uiComponent:UIComponent, stateName:String):State

Returns the given UIComponent's State object associated with the specified state name.

Parameters
uiComponent:UIComponent — The component to check for the given states
 
stateName:String — of the State to return from the given UIComponent

Returns
State — The specified State object in the UIComponent's state array.
getStateIndex()method 
public static function getStateIndex(uiComponent:UIComponent, stateName:String):int

Returns the index of the specified State in the given UIComponent.

Parameters
uiComponent:UIComponent — The component to check for the given states
 
stateName:String — of the State whose index to return from the given UIComponent

Returns
int — The index of the specified State in the UIComponent's state array.
isBasedOn()method 
public static function isBasedOn(uiComponent:UIComponent, baseStateName:String, proposedChildStateName:String, allowIdentity:Boolean = true):Boolean

Determines if one state is based upon another. If the includeIdentity parameter is set to true, the base state and proposed child state may be one and the same and still return true.

Parameters
uiComponent:UIComponent — The component to check for the given states
 
baseStateName:String — The ancestor State
 
proposedChildStateName:String — The proposed child State of the ancestor State
 
allowIdentity:Boolean (default = true) — Returns true if base state and child state are one and the same (based on itself)

Returns
Boolean — True if the proposed child state is a based on the specified base state of the given UIComponent, otherwise false.
isLeavingState()method 
public static function isLeavingState(uiComponent:UIComponent, state:String, oldState:String, newState:String, checkAncestors:Boolean = true):Boolean

Determines if the given UIComponent is leaving the specified state, or any decendant of that state (i.e. a state based on the specified state).

Parameters
uiComponent:UIComponent
 
state:String — is that state desired to know if the UIComponent is leaving
 
oldState:String — is the old state of the UIComponent
 
newState:String — is the new state of the UIComponent
 
checkAncestors:Boolean (default = true)

Returns
Boolean — true if the given UIComponent is leaving a state