Packageorg.flintparticles.common.activities
Interfacepublic interface Activity
ImplementorsActivityBase

The Activity interface must be implemented by all emitter activities.

An Activity is a class that is used to continuously modify an aspect of an emitter by updating the emitter every frame. Activities may, for example, move or rotate the emitter.

Activities are associated with emitters by using the emitter's addActivity method. Activities are removed from the emitter by using the emitter's removeActivity method.

See also

org.flintparticles.common.emitters.Emitter.addActivity()
org.flintparticles.common.emitters.Emitter.removeActivity()


Public Methods
 MethodDefined by
  
addedToEmitter(emitter:Emitter):void
The addedToEmitter method is called by the emitter when the Activity is added to it.
Activity
  
The getDefaultPriority method is used to order the execution of activities.
Activity
  
initialize(emitter:Emitter):void
The initialize method is used by the emitter to start the activity.
Activity
  
The removedFromEmitter method is called by the emitter when the Activity is removed from it.
Activity
  
update(emitter:Emitter, time:Number):void
The update method is used by the emitter to apply the activity.
Activity
Method detail
addedToEmitter()method
public function addedToEmitter(emitter:Emitter):void

The addedToEmitter method is called by the emitter when the Activity is added to it. It is an opportunity for an activity to do any initializing that is relative to the emitter. Only a few activities make use of this method. It is called within the emitter's addActivity method and need not be called by the user.

Parameters
emitter:Emitter — The Emitter that the Activity was added to.

See also

getDefaultPriority()method 
public function getDefaultPriority():Number

The getDefaultPriority method is used to order the execution of activities. It should return a number indicating the priority for the execution of the activity. Activities with a higher priority are run before activities with a lower priority.

The activities within the Flint library use 0 as the default priority. Activities that need to be called early would have priorities of 10 or 20. Activities that need to be called late would have priorities of -10 or -20.

The default priority can be overridden when adding an activity to an emitter by setting a new priority in the second parameter of the addActivity method of the emitter.

The getDefaultPriority method is called internally by the emitter and need not be called directly by the user.

Returns
Number

See also

initialize()method 
public function initialize(emitter:Emitter):void

The initialize method is used by the emitter to start the activity. It is called within the emitter's start method and need not be called by the user.

Parameters
emitter:Emitter — The Emitter that is using the activity.
removedFromEmitter()method 
public function removedFromEmitter(emitter:Emitter):void

The removedFromEmitter method is called by the emitter when the Activity is removed from it. It is an opportunity for an activity to do any finalizing that is relative to the emitter. Only a few activities make use of this method. It is called within the emitter's removeActivity method and need not be called by the user.

Parameters
emitter:Emitter — The Emitter that the Activity was removed from.

See also

update()method 
public function update(emitter:Emitter, time:Number):void

The update method is used by the emitter to apply the activity. It is the key feature of the activity and is used to update the state of the emitter. This method is called within the emitter's update loop and need not be called by the user.

Parameters
emitter:Emitter — The Emitter that is using the activity.
 
time:Number — The duration of the frame (in seconds) - used for time based updates.