Packagecom.yworks.support
Classpublic class Transition
InheritanceTransition Inheritance flash.events.EventDispatcher

A transition for use in a StateMachine.

A transition connects to States and is created using the StateMachine.createTransition method.



Public Properties
 PropertyDefined By
  enabled : Boolean
Enables or disables this transition.
Transition
  eventRecognizer : Function
Gets or sets the event recognizer that will be used in the isTrigger method.
Transition
  source : State
[read-only] The source state this transition connects to.
Transition
  tag : Object
Gets or sets a custom tag that is associated with this transition.
Transition
  target : State
[read-only] The target state this transition connects to.
Transition
Public Methods
 MethodDefined By
  
Transition(owner:StateMachine, source:State, target:State, er:Function = null, transDoneCallback:Function = null)
Creates a transition between two states for a StateMachine
Transition
  
isTrigger(evt:Event):Boolean
Determines whether this transition is triggered by the given event.
Transition
  
toString():String
[override] A String representation of this transition.
Transition
Events
 Event Summary Defined By
  Dispatched when the transition has been traversed.Transition
Property Detail
enabledproperty
enabled:Boolean

Enables or disables this transition.

A disabled transition will not be traversed by the state machine automatically.


Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
eventRecognizerproperty 
eventRecognizer:Function

Gets or sets the event recognizer that will be used in the isTrigger method.


Implementation
    public function get eventRecognizer():Function
    public function set eventRecognizer(value:Function):void
sourceproperty 
source:State  [read-only]

The source state this transition connects to.


Implementation
    public function get source():State
tagproperty 
tag:Object

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


Implementation
    public function get tag():Object
    public function set tag(value:Object):void
targetproperty 
target:State  [read-only]

The target state this transition connects to.


Implementation
    public function get target():State
Constructor Detail
Transition()Constructor
public function Transition(owner:StateMachine, source:State, target:State, er:Function = null, transDoneCallback:Function = null)

Creates a transition between two states for a StateMachine

Parameters
owner:StateMachine — the StateMachine this transition belongs to.
 
source:State — The source state.
 
target:State — The target state.
 
er:Function (default = null) — An event recognizer that determines whether a given event triggers this transition.
 
transDoneCallback:Function (default = null) — Event listener for the transitionDone event. The listener has to take a TransitionEvent as an argument.
Method Detail
isTrigger()method
public function isTrigger(evt:Event):Boolean

Determines whether this transition is triggered by the given event.

Parameters

evt:Event — The event to check.

Returns
Booleantrue if the given event can trigger this tranision
toString()method 
override public function toString():String

A String representation of this transition.

Returns
String — A String representation of this transition.
Event Detail
transitionDone Event
Event Object Type: com.yworks.support.TransitionEvent
TransitionEvent.type property = com.yworks.support.TransitionEvent.TRANSITION_DONE

Dispatched when the transition has been traversed.