Packagecom.eqsim.FStEng
Classpublic class PulseActivity
InheritancePulseActivity Inheritance flash.events.EventDispatcher

Time-based or frame-based state activity.

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.

When you create a pulse activity, you tell the constructor whether you want to invoke the action (function) at an interval of milliseconds or of number of frames elapsed.



Public Properties
 PropertyDefined By
  frameBased : Boolean
Frame-based or time-based.
PulseActivity
  handler : Function
Handler routine for this pulse activity.
PulseActivity
  intvl : uint
Interval of pulse.
PulseActivity
Public Methods
 MethodDefined By
  
PulseActivity(interval:uint, origState:State, cb:Function, fb:Boolean = false)
Creates an instance of a Pulse Activity.
PulseActivity
Public Constants
 ConstantDefined By
  TICK : String = TICK
[static] Event sent on each pulse of the activity.
PulseActivity
Property Detail
frameBasedproperty
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.

handlerproperty 
public var handler:Function

Handler routine for this pulse activity.

intvlproperty 
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.

Constructor Detail
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.

Parameters
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.
Constant Detail
TICKConstant
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.