Packageorg.flintparticles.common.actions
Classpublic class TargetColor
InheritanceTargetColor Inheritance ActionBase Inheritance Object

The TargetColor action adjusts the color of the particle towards a target color. On every update the color of the particle moves a little closer to the target color. The rate at which particles approach the target is controlled by the rate property.



Public Properties
 PropertyDefined By
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
  rate : Number
Adjusts how quickly the particle reaches the target color.
TargetColor
  targetColor : Number
The target color.
TargetColor
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
TargetColor(targetColor:uint = 0xFFFFFF, rate:Number = 0.1)
The constructor creates a TargetColor action for use by an emitter.
TargetColor
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActionBase
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Adjusts the color of the particle based on its current color, the target color and the time elapsed.
TargetColor
Property Detail
rateproperty
rate:Number

Adjusts how quickly the particle reaches the target color. Larger numbers cause it to approach the target color more quickly.


Implementation
    public function get rate():Number
    public function set rate(value:Number):void
targetColorproperty 
targetColor:Number

The target color. This is a 32 bit color of the form 0xAARRGGBB.


Implementation
    public function get targetColor():Number
    public function set targetColor(value:Number):void
Constructor Detail
TargetColor()Constructor
public function TargetColor(targetColor:uint = 0xFFFFFF, rate:Number = 0.1)

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

Parameters
targetColor:uint (default = 0xFFFFFF) — The target color. This is a 32 bit color of the form 0xAARRGGBB.
 
rate:Number (default = 0.1) — Adjusts how quickly the particle reaches the target color. Larger numbers cause it to approach the target color more quickly.

See also

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

Adjusts the color of the particle based on its current color, the target color and the time elapsed.

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