Packageorg.puremvc.as3.utilities.statemachine
Classpublic class FSMInjector
InheritanceFSMInjector Inheritance org.puremvc.as3.patterns.observer.Notifier

Creates and registers a StateMachine described in XML.

This allows reconfiguration of the StateMachine without changing any code, as well as making it easier than creating all the State instances and registering them with the StateMachine at startup time.



Protected Properties
 PropertyDefined by
  fsm : XML
FSMInjector
  stateList : Array
FSMInjector
  states : Array
[read-only] Get the state definitions.
FSMInjector
Public Methods
 MethodDefined by
  
FSMInjector(fsm:XML)
Constructor.
FSMInjector
  
inject():void
Inject the StateMachine into the PureMVC apparatus.
FSMInjector
Protected Methods
 MethodDefined by
  
createState(stateDef:XML):State
Creates a State instance from its XML definition.
FSMInjector
  
isInitial(stateName:String):Boolean
Is the given state the initial state?
FSMInjector
Property detail
fsmproperty
protected var fsm:XML
stateListproperty 
protected var stateList:Array
statesproperty 
states:Array  [read-only]

Get the state definitions.

Creates and returns the array of State objects from the FSM on first call, subsequently returns the existing array.

Implementation
    protected function get states():Array
Constructor detail
FSMInjector()constructor
public function FSMInjector(fsm:XML)

Constructor.

Parameters
fsm:XML
Method detail
createState()method
protected function createState(stateDef:XML):State

Creates a State instance from its XML definition.

Parameters
stateDef:XML

Returns
State
inject()method 
public function inject():void

Inject the StateMachine into the PureMVC apparatus.

Creates the StateMachine instance, registers all the states and registers the StateMachine with the IFacade.

isInitial()method 
protected function isInitial(stateName:String):Boolean

Is the given state the initial state?

Parameters
stateName:String

Returns
Boolean