Packageorg.flintparticles.common.actions
Classpublic class KeyDownAction
InheritanceKeyDownAction Inheritance ActionBase Inheritance Object

The KeyDownAction Action uses another action. It applies the other action to the particles only if a specified key is down.

See also

org.flintparticles.common.actions.Action


Public Properties
 PropertyDefined By
  action : Action
The action to apply when the key is down.
KeyDownAction
  keyCode : uint
The key code of the key that controls the action.
KeyDownAction
  priority : int
[override] Returns the default priority of the action that is applied.
KeyDownAction
  stage : Stage
A reference to the stage
KeyDownAction
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
KeyDownAction(action:Action = null, keyCode:uint = 0, stage:Stage = null)
The constructor creates a KeyDownAction action for use by an emitter.
KeyDownAction
  
addedToEmitter(emitter:Emitter):void
[override] Calls the addedToEmitter method of the action that is applied
KeyDownAction
  
[override] Calls the removedFromEmitter method of the action that is applied
KeyDownAction
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] If the key is down, this method calls the update method of the action that is applied.
KeyDownAction
Property Detail
actionproperty
action:Action

The action to apply when the key is down.


Implementation
    public function get action():Action
    public function set action(value:Action):void
keyCodeproperty 
keyCode:uint

The key code of the key that controls the action.


Implementation
    public function get keyCode():uint
    public function set keyCode(value:uint):void
priorityproperty 
priority:int[override]

Returns the default priority of the action that is applied.


Implementation
    public function get priority():int
    public function set priority(value:int):void

See also

stageproperty 
stage:Stage

A reference to the stage


Implementation
    public function get stage():Stage
    public function set stage(value:Stage):void
Constructor Detail
KeyDownAction()Constructor
public function KeyDownAction(action:Action = null, keyCode:uint = 0, stage:Stage = null)

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

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

See also

org.flintparticles.emitters.Emitter.addAction()
Method Detail
addedToEmitter()method
override public function addedToEmitter(emitter:Emitter):void

Calls the addedToEmitter method of the action that is applied

Parameters

emitter:Emitter — The Emitter that the Action was added to.

See also

removedFromEmitter()method 
override public function removedFromEmitter(emitter:Emitter):void

Calls the removedFromEmitter method of the action that is applied

Parameters

emitter:Emitter — The Emitter that the Action was removed from.

See also

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

If the key is down, this method calls the update method of the action that is applied.

This method is called by the emitter and need not be called by the user

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.

See also