|Interface||public interface Action extends Behaviour|
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.
|priority : int|
The priority property is used to order the execution of behaviours.
The addedToEmitter method is called by the emitter when the Behaviour is added to it.
The removedFromEmitter method is called by the emitter when the Behaviour is removed from it.
The update method is used by the emitter to apply the action to every particle.
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.