Packageorg.flintparticles.common.counters
Classpublic class KeyDownCounter
InheritanceKeyDownCounter Inheritance Object
Implements Counter

The KeyDownCounter Counter modifies another counter to only emit particles when a specific key is being pressed.



Public Properties
 PropertyDefined By
  complete : Boolean
[read-only] Indicates if the counter has emitted all its particles.
KeyDownCounter
  counter : Counter
The counter to use when the key is down.
KeyDownCounter
  keyCode : uint
The key code of the key that controls the counter.
KeyDownCounter
  running : Boolean
[read-only] Indicates if the counter is currently emitting particles
KeyDownCounter
  stage : Stage
A reference to the stage
KeyDownCounter
Public Methods
 MethodDefined By
  
KeyDownCounter(counter:Counter = null, keyCode:uint = 0, stage:Stage = null)
The constructor creates a ZonedAction action for use by an emitter.
KeyDownCounter
  
resume():void
Resumes the emitter after a stop
KeyDownCounter
  
startEmitter(emitter:Emitter):uint
KeyDownCounter
  
stop():void
Stops the emitter from emitting particles
KeyDownCounter
  
updateEmitter(emitter:Emitter, time:Number):uint
The updateEmitter method is called every frame after the emitter has started.
KeyDownCounter
Property Detail
completeproperty
complete:Boolean  [read-only]

Indicates if the counter has emitted all its particles.


Implementation
    public function get complete():Boolean
counterproperty 
counter:Counter

The counter to use when the key is down.


Implementation
    public function get counter():Counter
    public function set counter(value:Counter):void
keyCodeproperty 
keyCode:uint

The key code of the key that controls the counter.


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

Indicates if the counter is currently emitting particles


Implementation
    public function get running():Boolean
stageproperty 
stage:Stage

A reference to the stage


Implementation
    public function get stage():Stage
    public function set stage(value:Stage):void
Constructor Detail
KeyDownCounter()Constructor
public function KeyDownCounter(counter:Counter = null, keyCode:uint = 0, stage:Stage = null)

The constructor creates a ZonedAction action for use by an emitter. To add a ZonedAction to all particles created by an emitter, use the emitter's addAction method.

Parameters
counter:Counter (default = null) — The counter to use when the key is down.
 
keyCode:uint (default = 0) — The key code of the key that controls the counter.
 
stage:Stage (default = null) — A reference to the stage.

See also

org.flintparticles.emitters.Emitter.addAction()
Method Detail
resume()method
public function resume():void

Resumes the emitter after a stop

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

Parameters

emitter:Emitter

Returns
uint
stop()method 
public function stop():void

Stops the emitter from emitting particles

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

The updateEmitter method is called every frame after the emitter has started.

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 emit at this time.