Packagenet.flashpunk.tweens.misc
Classpublic class ColorTween
InheritanceColorTween Inheritance Tween Inheritance Object

Tweens a color's red, green, and blue properties independently. Can also tween an alpha value.



Public Properties
 PropertyDefined By
 Inheritedactive : Boolean
If the tween should update.
Tween
  alpha : Number = 1
The current alpha.
ColorTween
  blue : uint
[read-only] Blue value of the current color, from 0 to 255.
ColorTween
  color : uint
The current color.
ColorTween
 Inheritedcomplete : Function
Tween completion callback.
Tween
 Inheriteddelay : Number = 0
Length of time to wait before starting this tween.
Tween
  green : uint
[read-only] Green value of the current color, from 0 to 255.
ColorTween
 Inheritedpercent : Number
The completion percentage of the Tween.
Tween
  red : uint
[read-only] Red value of the current color, from 0 to 255.
ColorTween
 Inheritedscale : Number
[read-only] The current time scale of the Tween (after easer has been applied).
Tween
Public Methods
 MethodDefined By
  
ColorTween(complete:Function = null, type:uint = 0)
Constructor.
ColorTween
 Inherited
cancel():void
Immediately stops the Tween and removes it from its Tweener without calling the complete callback.
Tween
 Inherited
start():void
Starts the Tween, or restarts it if it's currently running.
Tween
  
tween(duration:Number, fromColor:uint, toColor:uint, fromAlpha:Number = 1, toAlpha:Number = 1, ease:Function = null):void
Tweens the color to a new color and an alpha to a new alpha.
ColorTween
 Inherited
update():void
Updates the Tween, called by World.
Tween
Public Constants
 ConstantDefined By
 InheritedLOOPING : uint = 1
[static] Looping Tween type, will restart immediately when it finishes.
Tween
 InheritedONESHOT : uint = 2
[static] Oneshot Tween type, will stop and remove itself from its core container when it finishes.
Tween
 InheritedPERSIST : uint = 0
[static] Persistent Tween type, will stop when it finishes.
Tween
Property Detail
alphaproperty
public var alpha:Number = 1

The current alpha.

blueproperty 
blue:uint  [read-only]

Blue value of the current color, from 0 to 255.


Implementation
    public function get blue():uint
colorproperty 
public var color:uint

The current color.

greenproperty 
green:uint  [read-only]

Green value of the current color, from 0 to 255.


Implementation
    public function get green():uint
redproperty 
red:uint  [read-only]

Red value of the current color, from 0 to 255.


Implementation
    public function get red():uint
Constructor Detail
ColorTween()Constructor
public function ColorTween(complete:Function = null, type:uint = 0)

Constructor.

Parameters
complete:Function (default = null) — Optional completion callback.
 
type:uint (default = 0) — Tween type.
Method Detail
tween()method
public function tween(duration:Number, fromColor:uint, toColor:uint, fromAlpha:Number = 1, toAlpha:Number = 1, ease:Function = null):void

Tweens the color to a new color and an alpha to a new alpha.

Parameters

duration:Number — Duration of the tween.
 
fromColor:uint — Start color.
 
toColor:uint — End color.
 
fromAlpha:Number (default = 1) — Start alpha
 
toAlpha:Number (default = 1) — End alpha.
 
ease:Function (default = null) — Optional easer function.