Package | com.eqsim.FStEng |
Class | public class PulseActivity |
Inheritance | PulseActivity ![]() |
A pulse activity is an action that gets triggered at some time- or frame-based interval while a
state is active. Like transitions, developers use a State's addPulseActivity
to attach
a pulse activity to a given State.
Property | Defined By | ||
---|---|---|---|
frameBased : Boolean
Frame-based or time-based. | PulseActivity | ||
handler : Function
Handler routine for this pulse activity. | PulseActivity | ||
intvl : uint
Interval of pulse. | PulseActivity |
Method | Defined By | ||
---|---|---|---|
PulseActivity(interval:uint, origState:State, cb:Function, fb:Boolean = false)
Creates an instance of a Pulse Activity. | PulseActivity |
Constant | Defined By | ||
---|---|---|---|
TICK : String = TICK [static]
Event sent on each pulse of the activity. | PulseActivity |
frameBased | property |
public var frameBased:Boolean
Frame-based or time-based.
Boolean value indicating true: pulse activity is frame-based, or false: pulse activity is time-based.
The default value is false
.
handler | property |
public var handler:Function
Handler routine for this pulse activity.
intvl | property |
public var intvl:uint
Interval of pulse.
Interval is in milliseconds if pulse activity is time-based, or is in number of frames if frame-based.
PulseActivity | () | Constructor |
public function PulseActivity(interval:uint, origState:State, cb:Function, fb:Boolean = false)
Creates an instance of a Pulse Activity.
Pulse Activities are time- or frame-based triggered actions that do not cause state changes (unless the
developer invokes a transition during the handling of the pulse. Developers send in the handler function to
the State's pulse activity creator, myStatePtr.addPulseActivity()
.
When a tick is generated, the handler receives an EventWithData
that has 1 property, event.data.state
.
This allows the handler to tell which state originated this pulse activity.
interval:uint — For time-based activities (the default), use milliseconds. For frame-based activities, use number of frames.
| |
origState:State — A pointer to the state on which the activity is defined.
| |
cb:Function — Callback function for event handler.
| |
fb:Boolean (default = false ) — Boolean value that is true for frame-based pulses, or false (default) for time-based.
|
TICK | Constant |
public static const TICK:String = TICK
Event sent on each pulse of the activity.
The developer tells the pulse activity how frequently to emit pulses. When the time elapses, the engine generates a TICK event that callers can register to listen for.