Packagecv.orion.output
Classpublic class KeyDownOutput
InheritanceKeyDownOutput Inheritance SteadyOutput
ImplementsIOutput

The KeyDownOutput class outputs particles if the specified key is pressed on the keyboard. It extends the SteadyOutput class, so the rate it outputs can also be adjusted.


Example
There are two ways to control output. The first way it so set it in the constructor. The second way is to add it via the output property.
  import cv.Orion;
  import cv.orion.output.KeyDownOutput;
  import flash.ui.Keyboard;
  
  // First method
  var e:Orion = new Orion(linkageClass, new KeyDownOutput(Keyboard.SPACE, this.stage, 40));
  
  // Second method
  var e2:Orion = new Orion(linkageClass);
  e2.output = new KeyDownOutput(Keyboard.SPACE, this.stage, 40)
  



Public Properties
 PropertyDefined by
 InheritedparticlesPerSecond : Number
The current rate assigned to SteadyOutput, in particles per second.
SteadyOutput
 Inheritedpaused : Boolean
Gets or sets the paused property
SteadyOutput
  target : DisplayObject
Gets or sets the target to attach the keyboard listener to.
KeyDownOutput
Public Methods
 MethodDefined by
  
KeyDownOutput(key:uint, target:DisplayObject = null, particlesPerSecond:Number = 20)
Starts and stops outputting particles based on keyboard interaction.
KeyDownOutput
 Inherited
pause():void
Pauses the output class.
SteadyOutput
 Inherited
play():void
Resumes or plays the output class.
SteadyOutput
  
update(emitter:Orion):void
This is called everytime the particles are called to update and be redrawn.
KeyDownOutput
Protected Methods
 MethodDefined by
 Inherited
checkEmit(emitter:Orion):void
Checks if it's time to emit particles and how many.
SteadyOutput
  
keyHandler(event:KeyboardEvent):void
Determines if they correct key is down or not.
KeyDownOutput
 Inherited
updateTimes(emitter:Orion):void
Updates the previous and difference in times.
SteadyOutput
Property detail
targetproperty
target:DisplayObject  [read-write]

Gets or sets the target to attach the keyboard listener to. As en example, you could set this to the stage.

Implementation
    public function get target():DisplayObject
    public function set target(value:DisplayObject):void
Constructor detail
KeyDownOutput()constructor
public function KeyDownOutput(key:uint, target:DisplayObject = null, particlesPerSecond:Number = 20)

Starts and stops outputting particles based on keyboard interaction.

Parameters
key:uint — Which key to listen for.
 
target:DisplayObject (default = null) — The target to attach the keyboard listener to.
 
particlesPerSecond:Number (default = 20) — The rate at which to output particles
Method detail
keyHandler()method
protected function keyHandler(event:KeyboardEvent):void

Determines if they correct key is down or not.

Parameters
event:KeyboardEvent
update()method 
public override function update(emitter:Orion):void

This is called everytime the particles are called to update and be redrawn. Depending on the output class, this can determine the output of the particles.

Parameters
emitter:Orion — The emitter to be used.