Packageorg.flintparticles.common.counters
Classpublic class TimePeriod
InheritanceTimePeriod Inheritance Object
Implements Counter

The TimePeriod counter causes the emitter to emit particles for a period of time and then stop. The rate of emission over that period can be modified using easing equations that conform to the interface defined in Robert Penner's easing equations. An update to these equations is included in the org.flintparticles.common.easing package.

See also

org.flintparticles.common.easing


Public Properties
 PropertyDefined By
  complete : Boolean
[read-only] Indicates if the counter has emitted all its particles.
TimePeriod
  duration : Number
The duration of the time period.
TimePeriod
  easing : Function
An easing function used to distribute the emission of the particles over the time period.
TimePeriod
  numParticles : uint
The number of particles to emit over the full duration of the time period.
TimePeriod
  running : Boolean
[read-only] Indicates if the counter is currently emitting particles
TimePeriod
Public Methods
 MethodDefined By
  
TimePeriod(numParticles:uint = 0, duration:Number = 0, easing:Function = null)
The constructor creates a TimePeriod counter for use by an emitter.
TimePeriod
  
resume():void
Resumes the emitter after a stop
TimePeriod
  
startEmitter(emitter:Emitter):uint
Initilizes the counter.
TimePeriod
  
stop():void
Stops the emitter from emitting particles
TimePeriod
  
updateEmitter(emitter:Emitter, time:Number):uint
Uses the time, timePeriod and easing function to calculate how many particles the emitter should emit now.
TimePeriod
Property Detail
completeproperty
complete:Boolean  [read-only]

Indicates if the counter has emitted all its particles.


Implementation
    public function get complete():Boolean
durationproperty 
duration:Number

The duration of the time period. After this time is up the emitter will not release any more particles.


Implementation
    public function get duration():Number
    public function set duration(value:Number):void
easingproperty 
easing:Function

An easing function used to distribute the emission of the particles over the time period.


Implementation
    public function get easing():Function
    public function set easing(value:Function):void
numParticlesproperty 
numParticles:uint

The number of particles to emit over the full duration of the time period.


Implementation
    public function get numParticles():uint
    public function set numParticles(value:uint):void
runningproperty 
running:Boolean  [read-only]

Indicates if the counter is currently emitting particles


Implementation
    public function get running():Boolean
Constructor Detail
TimePeriod()Constructor
public function TimePeriod(numParticles:uint = 0, duration:Number = 0, easing:Function = null)

The constructor creates a TimePeriod counter for use by an emitter. To add a TimePeriod counter to an emitter use the emitter's counter property.

Parameters
numParticles:uint (default = 0) — The number of particles to emit over the full duration of the time period
 
duration:Number (default = 0) — The duration of the time period. After this time is up the emitter will not release any more particles.
 
easing:Function (default = null) — An easing function used to distribute the emission of the particles over the time period. If no easing function is passed a simple linear distribution is used in which particles are emitted at a constant rate over the time period.

See also

org.flintparticles.common.emitter.Emitter.counter
Method Detail
resume()method
public function resume():void

Resumes the emitter after a stop

startEmitter()method 
public function startEmitter(emitter:Emitter):uint

Initilizes the counter. Returns 0 to indicate that the emitter should emit no particles when it starts.

This method is called within the emitter's start method and need not be called by the user.

Parameters

emitter:Emitter — The emitter.

Returns
uint — 0

See also

stop()method 
public function stop():void

Stops the emitter from emitting particles

updateEmitter()method 
public function updateEmitter(emitter:Emitter, time:Number):uint

Uses the time, timePeriod and easing function to calculate how many particles the emitter should emit now.

This method is called within the emitter's update loop and need not be called by the user.

Parameters

emitter:Emitter — The emitter.
 
time:Number — The time, in seconds, since the previous call to this method.

Returns
uint — the number of particles the emitter should create.

See also