Packageorg.flintparticles.common.activities
Classpublic class UpdateOnFrame
InheritanceUpdateOnFrame Inheritance ActivityBase Inheritance Object

The UpdateOnFrame activity is used to call a frameUpdate method of an object that implements the FrameUpdatable interface. The frameUpdate method is called once every frame.

This activity is most often used to update an action once every frame. Because the update method of an action is called once for every particle, every frame, there is no obvious point for an action to implement code that should be called once only every frame, irrespective of the number of particles. If the action implements FrameUpdatable and adds an UpdateOnFrame activity to the emitter in its addedToEmitter method, the frameUpdate method will be called once every frame.

See the Explosion Action for an example of an action that uses this activity.

See also

org.flintparticles.twoD.actions.Explosion


Public Properties
 PropertyDefined By
 Inheritedpriority : int
Returns a default priority of 0 for this activity.
ActivityBase
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActivityBase
Public Methods
 MethodDefined By
  
The constructor creates an UpdateOnFrame activity.
UpdateOnFrame
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActivityBase
 Inherited
initialize(emitter:Emitter):void
This method does nothing.
ActivityBase
 Inherited
This method does nothing.
ActivityBase
  
update(emitter:Emitter, time:Number):void
[override] Calls the frameUpdate method of the FrameUpdatable object associated with this activity.
UpdateOnFrame
Constructor Detail
UpdateOnFrame()Constructor
public function UpdateOnFrame(frameUpdatable:FrameUpdatable)

The constructor creates an UpdateOnFrame activity.

Parameters
frameUpdatable:FrameUpdatable — The object that shouldbe updated every frame.
Method Detail
update()method
override public function update(emitter:Emitter, time:Number):void

Calls the frameUpdate method of the FrameUpdatable object associated with this activity.

This method is called by the emitter and need not be called by the user

Parameters

emitter:Emitter — The Emitter.
 
time:Number — The duration of the frame - used for time based updates.

See also

org.flintparticles.common.actions.Activity.update()