Packagecom.yworks.support
Classpublic class State
InheritanceState Inheritance flash.events.EventDispatcher

A state for use in a stateMachine

A state may be connected to other states via Transitions. Creating a state is done via the StateMachine.createState method.



Public Properties
 PropertyDefined By
  enabled : Boolean
Enables or disables this transition.
State
  tag : Object
Gets or sets a custom tag that is associated with this state.
State
Public Methods
 MethodDefined By
  
State(owner:StateMachine, stateEnteredHandler:Function = null)
Creates a new instance.
State
  
toString():String
[override] A String representation of this.
State
Events
 Event Summary Defined By
  Dispatched once the machine enters this state.State
  Dispatched once the machine exits this state.State
Property Detail
enabledproperty
enabled:Boolean

Enables or disables this transition.

A state machine will not automatically enter a state that is disabled.


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
tagproperty 
tag:Object

Gets or sets a custom tag that is associated with this state.


Implementation
    public function get tag():Object
    public function set tag(value:Object):void
Constructor Detail
State()Constructor
public function State(owner:StateMachine, stateEnteredHandler:Function = null)

Creates a new instance.

Parameters
owner:StateMachine — The StateMachine that owns this instance.
 
stateEnteredHandler:Function (default = null) — An event handler for StateChangeEvent.STATE_ENTERED.
Method Detail
toString()method
override public function toString():String

A String representation of this.

Returns
String
Event Detail
stateEntered Event
Event Object Type: com.yworks.support.StateChangeEvent
StateChangeEvent.type property = com.yworks.support.StateChangeEvent.STATE_ENTERED

Dispatched once the machine enters this state.

stateExited Event  
Event Object Type: com.yworks.support.StateChangeEvent
StateChangeEvent.type property = com.yworks.support.StateChangeEvent.STATE_EXITED

Dispatched once the machine exits this state.