Packagecom.flashdynamix.motion.extras
Classpublic class Emitter
InheritanceEmitter Inheritance flash.display.Sprite

This is used as a particle emitter for Objects of a specified DisplayObject Class



Public Properties
 PropertyDefined by
  angle : *
The angle in degrees to allow the particles to move to :
  • "0-360" allows for any random rotation.
  • "-90-90" only allows for a random rotation between -90 and 90.
  • 90 only allows for particles to move at a rotation value of 90 degree.s
Emitter
  delay : Number = 0
The amount of delay in seconds before a particle begins to move to its target destination.
Emitter
  distance : *
The distance to allow particles to move to :
  • "10-100" allows for particles to move a distance between 10 and 100 pixels.
  • 100 only allows for particles to move a distance of 100 pixels.
Emitter
  ease : Function
The ease equation used for the particle motion animations
Emitter
  endColor : ColorTransform
Allows for tweening the particles color over its lifespan.
This value can be an Object defining the target redOffset, blueOffset, greenOffset etc.
Or it can be a ColorTransform defining the end color.
Emitter
  frequency : int
How many particles are created on each ENTER_FRAME.
Emitter
  holder : Sprite
The container Sprite for particles.
Emitter
  random : Number
How often particles are created on each ENTER_FRAME.
If 0.5 particles will only be created half the time.
Emitter
  refreshType : String
The timing system currently in use.
This can be either :
  • Tweensy.TIME
  • Tweensy.FRAME
Emitter
  running : Boolean = false
Defines whether the Emitter is rendering.
Emitter
  scale : Number
Gets the scale of the Emmitter.
Emitter
  secondsPerFrame : Number
Emitter
  speed : Number
The time in seconds it takes for a particle to get to its end position.
Emitter
  startDistance : Number = 0
The distance in pixels to start the particle Object at.
Emitter
  target : Object
Additional properties to tween during the particle's lifespan.
i.e.
Emitter
Public Methods
 MethodDefined by
  
Emitter(Particle:Class, target:Object = null, frequency:int = 5, random:Number = 1, angle:Number = 0,360, distance:String = "20", speed:* = 1, blendMode:* = normal)
Emitter
  
Clones the Emmitter and returns a new instance.
Emitter
  
dispose():void
Disposes the Emitter Class ready for garbage collection
Emitter
  
pause():void
Pauses all playing particle tweens.
Emitter
  
resume():void
Resumes all paused particle tweens.
Emitter
  
start():void
Starts adding particle tweens on each ENTER_FRAME.
Emitter
  
stop():void
Stops adding particle tweens on each ENTER_FRAME.
Emitter
Protected Methods
 MethodDefined by
  
addEvent(item:EventDispatcher, type:String, liststener:Function, priority:int = 0, useWeakReference:Boolean = true):void
Emitter
  
removeEvent(item:EventDispatcher, type:String, listener:Function):void
Emitter
Property detail
angleproperty
public var angle:*

The angle in degrees to allow the particles to move to :

delayproperty 
public var delay:Number = 0

The amount of delay in seconds before a particle begins to move to its target destination.

distanceproperty 
public var distance:*

The distance to allow particles to move to :

easeproperty 
public var ease:Function

The ease equation used for the particle motion animations

endColorproperty 
public var endColor:ColorTransform

Allows for tweening the particles color over its lifespan.
This value can be an Object defining the target redOffset, blueOffset, greenOffset etc.
Or it can be a ColorTransform defining the end color.

frequencyproperty 
public var frequency:int

How many particles are created on each ENTER_FRAME.

holderproperty 
public var holder:Sprite

The container Sprite for particles.

randomproperty 
public var random:Number

How often particles are created on each ENTER_FRAME.
If 0.5 particles will only be created half the time. By default this is set to 1.

refreshTypeproperty 
refreshType:String  [read-write]

The timing system currently in use.
This can be either :

Implementation
    public function get refreshType():String
    public function set refreshType(value:String):void

See also

runningproperty 
public var running:Boolean = false

Defines whether the Emitter is rendering.

scaleproperty 
scale:Number  [read-write]

Gets the scale of the Emmitter.

Implementation
    public function get scale():Number
    public function set scale(value:Number):void
secondsPerFrameproperty 
secondsPerFrame:Number  [read-write]Implementation
    public function get secondsPerFrame():Number
    public function set secondsPerFrame(value:Number):void
speedproperty 
public var speed:Number

The time in seconds it takes for a particle to get to its end position.

startDistanceproperty 
public var startDistance:Number = 0

The distance in pixels to start the particle Object at.

targetproperty 
public var target:Object

Additional properties to tween during the particle's lifespan.
i.e. {scaleX:2, scaleY:2} would scale the DisplayObject by a factor of 2 over its lifespan.

Constructor detail
Emitter()constructor
public function Emitter(Particle:Class, target:Object = null, frequency:int = 5, random:Number = 1, angle:Number = 0,360, distance:String = "20", speed:* = 1, blendMode:* = normal)

Parameters
Particle:Class — The DisplayObject Class used to construct particles.
 
target:Object (default = null) — Additional properties to tween during the particle's lifespan.
i.e. {scaleX:2, scaleY:2} would scale the DisplayObject by a factor of 2 over its lifespan.
 
frequency:int (default = 5) — How many particles are created on each ENTER_FRAME.
 
random:Number (default = 1) — How often particles are created on each ENTER_FRAME.
If 0.5 particles will only be created half the time. By default this is set to 1.
 
angle:Number (default = 0,360) — The angle in degrees to allow the particles to move to:
  • "0-360" allows for any random rotation.
  • "-90-90" only allows for a random rotation between -90 and 90.
  • 90 only allows for particles to move at a rotation value of 90 degrees.
 
distance:String (default = "20") — The distance to allow particles to move to:
  • "10-100" allows for particles to move a distance between 10 and 100 pixels.
  • 100 only allows for particles to move a distance of 100 pixels.
 
speed:* (default = 1) — The time in seconds it takes for a particle to get to its end position.
 
blendMode:* (default = normal) — The BlendMode applied to the particle.
Method detail
addEvent()method
protected function addEvent(item:EventDispatcher, type:String, liststener:Function, priority:int = 0, useWeakReference:Boolean = true):voidParameters
item:EventDispatcher
 
type:String
 
liststener:Function
 
priority:int (default = 0)
 
useWeakReference:Boolean (default = true)
clone()method 
public function clone():Emitter

Clones the Emmitter and returns a new instance.

Returns
Emitter
dispose()method 
public function dispose():void

Disposes the Emitter Class ready for garbage collection

pause()method 
public function pause():void

Pauses all playing particle tweens.

removeEvent()method 
protected function removeEvent(item:EventDispatcher, type:String, listener:Function):voidParameters
item:EventDispatcher
 
type:String
 
listener:Function
resume()method 
public function resume():void

Resumes all paused particle tweens.

start()method 
public function start():void

Starts adding particle tweens on each ENTER_FRAME.

stop()method 
public function stop():void

Stops adding particle tweens on each ENTER_FRAME. Though doesnt stop current particle tweens.