Packagecom.eqsim.FStEng
Classpublic class HState
InheritanceHState Inheritance HStateC Inheritance State Inheritance flash.events.EventDispatcher

A hierarchical state with a single sub-network. Hierarchical states can either have a single sub-network (collection of sub-states)--HState, or multiple networks of sub-states (HStateC). The HState is really a specialization of an HStateC that only has one sub-network. Therefore, all the real code is going on in HStateC.



Public Properties
 PropertyDefined By
 InheritedhandledEvYet : Boolean
Boolean flag used to determine if the State has handled the current event.
State
 Inheritedid : String
String identifier for the state.
State
 InheritedmyStMgr : StateManager
Pointer to this State's State Manager instance.
State
 Inheritedname : String
An optional name for the State to give to the State Manager, used for display purposes only.
State
 InheritednumStMgrs : uint
Number of state managers (i.e., sub-networks) within this state.
HStateC
 InheritedpulseActivities : Array
An array containing the pulse activities (PulseActivity) for this state.
State
 Inherited_se : StateEngine
Pointer to the State Engine instance.
State
 InheritedstMgrs : Object
An object that holds a hash table (indexed by State Manager id's) to the State Managers for this state.
HStateC
 Inheritedsubstates : Object
Collection of children states.
HStateC
 Inheritedtransitions : Object
An Object, keyed by target state id, that contains all the transitions for this State.
State
Public Methods
 MethodDefined By
  
HState(identifier:*, msm:StateManager = null, nm:String = null)
Create a new hierarchical state with a single sub-network.
HState
 Inherited
addPulseActivity(intvl:uint, cb:Function, fb:Boolean = false):PulseActivity
Use this method to add an activity to the state that fires at a specified interval.
State
 Inherited
Adds the specified state manager (StateManager) to this state.
HStateC
 Inherited
addSubHState(sid:String, mgr:StateManager = null, name:String = null):HState
Given an identifier, create a new sub-state that is a hierarchical state (HState).
HStateC
 Inherited
addSubHStateC(sid:String, mgr:StateManager = null, name:String = null):HStateC
Given an identifier, create a new sub-state that is a concurrent, hierarchical state (HStateC).
HStateC
 Inherited
addSubState(sid:String, mgr:StateManager = null, name:String = null):State
Given an identifier, create a new sub-state that is a simple state (State).
HStateC
 Inherited
addTransitionExternal(tEvtName:String, targetStateID:String, transFn:Function = null, ulfxt:uint = 1):Transition
Add an 'external' transition, i.e., from this State to a target state.
State
 Inherited
addTransitionToHistory(tEvtName:String, targetStateID:String, transFn:Function = null):Transition
Add a transition from the current state to the history pseudo-state of a state.
State
 Inherited
addTransitionToSelf(tEvtName:String, transFn:Function = null, ulfst:int = 0):Transition
Add a transition from this State to itself, specifying parents to exit and re-enter.
State
 Inherited
addTransitionToTarget(tEvtName:String, targetStateID:String, transFn:Function = null):Transition
Add a transition from this State to a target state other than history.
State
 Inherited
chgSt(trans:Transition, val:* = null):void
Change state using transition trans_i, with an optional value for the transition function as a second argument.
State
 Inherited
enter(hist:Boolean = false, specIDs:Array = null):void
Called when a state is entered.
State
 Inherited
isActive():Boolean
convenience function.
State
 Inherited
isSubstate(st:State):Boolean
[override] isSubstate allows the caller to ask if a state is a substate of the state being called.
HStateC
 Inherited
leave():void
Called when the state is exited (deactivated).
State
 Inherited
onEvent(ev:Event, handledYet:Boolean):Boolean
This is a new feature of FStEng v1.5, which provides an easy way to direct and process events.
State
 Inherited
Goes through substates to register them with the state engine.
State
 Inherited
Removes the specified pulse activity from the state.
State
 Inherited
[override] Deletes memory associated with this state.
HStateC
 Inherited
Remove the given transition from this State.
State
 Inherited
State
  
setDefaultStartState(sid:String, mgr:StateManager = null):void
[override] Allows the developer to specify the default start state.
HState
Public Constants
 ConstantDefined By
 InheritedENTRY : String = ENTRY
[static] Event generated on entry to a state.
State
 InheritedLEAVE : String = LEAVE
[static] Event generated when the state is no longer active.
State
Constructor Detail
HState()Constructor
public function HState(identifier:*, msm:StateManager = null, nm:String = null)

Create a new hierarchical state with a single sub-network.

You must assign the HState a unique identifier with respect to its sibling states, i.e., the states in the same network as this HState. Identifiers for states are, by convention, numeric, though the implementation uses Strings for identifiers (since numeric comparison is never required).

When you create an HState, you must also create a state manager (StateManager). When you create a StateManager, you specify the hierarchical state which it manages.

Parameters
identifier:* — State identifier (id). Must be unique among all states in the state engine.
 
msm:StateManager (default = null) — Pointer to the StateManager in the network that this HStateC belongs. Pass in the parent state, not the StateManager that will control this state's sub-network.
 
nm:String (default = null) — Display name of the State. If null (not supplied), routines use the id for the display name.
Method Detail
setDefaultStartState()method
override public function setDefaultStartState(sid:String, mgr:StateManager = null):void

Allows the developer to specify the default start state.

The default start state is specified in the State Manager, but for HState's, there is only one manager, so we can go ahead (if the manager is set) to adjust the default start state.

Parameters

sid:String — String identifier for the state
 
mgr:StateManager (default = null) — Optional parameter specifying the manager for the HState's sub-network (who is the manager for the state you're making default start). This is declared for consistency with HStateC, though it always will be null for HState's (since we can determine it automatically)