Packageorg.flintparticles.common.actions
Interfacepublic interface Action extends Behaviour
Implementors ActionBase

The Action interface must be implemented by all particle actions.

An Action is a class that is used to continuously modify an aspect of a particle by updating the particle every frame. Actions may, for example, move the particle or modify its velocity.

Actions are directly associated with emitters and act on all particles created or added to that emitter. Actions are applied to all particles created by an emitter by using the emitter's addAction method. Actions are removed from the emitter by using the emitter's removeAction method.

The key method in the Action interface is the update method. This is called every frame, for every particle and is where the action modifies the particle's properties.

See also

org.flintparticles.common.emitters.Emitter.addAction()
org.flintparticles.common.emitters.Emitter.removeAction()


Public Properties
 PropertyDefined By
 Inheritedpriority : int
The priority property is used to order the execution of behaviours.
Behaviour
Public Methods
 MethodDefined By
 Inherited
addedToEmitter(emitter:Emitter):void
The addedToEmitter method is called by the emitter when the Behaviour is added to it.
Behaviour
 Inherited
The removedFromEmitter method is called by the emitter when the Behaviour is removed from it.
Behaviour
  
update(emitter:Emitter, particle:Particle, time:Number):void
The update method is used by the emitter to apply the action to every particle.
Action
Method Detail
update()method
public function update(emitter:Emitter, particle:Particle, time:Number):void

The update method is used by the emitter to apply the action to every particle. It is the key feature of the actions and is used to update the state of every particle every frame. This method is called within the emitter's update loop for every particle and need not be called by the user.

Because the method is called for every particle, every frame it is a key area for optimization of the code. When creating a custom action it is usually worth making this method as efficient as possible.

Parameters

emitter:Emitter — The Emitter that created the particle.
 
particle:Particle — The particle to be updated.
 
time:Number — The duration of the frame - used for time based updates.