Packagenet.flashpunk
Classpublic class Tween
InheritanceTween Inheritance Object
Subclasses Alarm, AngleTween, ColorTween, Fader, Motion, MultiVarTween, NumTween, SfxFader, VarTween

Base class for all Tween objects, can be added to any Core-extended classes.



Public Properties
 PropertyDefined By
  active : Boolean
If the tween should update.
Tween
  complete : Function
Tween completion callback.
Tween
  delay : Number = 0
Length of time to wait before starting this tween.
Tween
  percent : Number
The completion percentage of the Tween.
Tween
  scale : Number
[read-only] The current time scale of the Tween (after easer has been applied).
Tween
Public Methods
 MethodDefined By
  
Tween(duration:Number, type:uint = 0, complete:Function = null, ease:Function = null)
Constructor.
Tween
  
cancel():void
Immediately stops the Tween and removes it from its Tweener without calling the complete callback.
Tween
  
start():void
Starts the Tween, or restarts it if it's currently running.
Tween
  
update():void
Updates the Tween, called by World.
Tween
Public Constants
 ConstantDefined By
  LOOPING : uint = 1
[static] Looping Tween type, will restart immediately when it finishes.
Tween
  ONESHOT : uint = 2
[static] Oneshot Tween type, will stop and remove itself from its core container when it finishes.
Tween
  PERSIST : uint = 0
[static] Persistent Tween type, will stop when it finishes.
Tween
Property Detail
activeproperty
public var active:Boolean

If the tween should update.

completeproperty 
public var complete:Function

Tween completion callback.

delayproperty 
public var delay:Number = 0

Length of time to wait before starting this tween.

percentproperty 
percent:Number

The completion percentage of the Tween.


Implementation
    public function get percent():Number
    public function set percent(value:Number):void
scaleproperty 
scale:Number  [read-only]

The current time scale of the Tween (after easer has been applied).


Implementation
    public function get scale():Number
Constructor Detail
Tween()Constructor
public function Tween(duration:Number, type:uint = 0, complete:Function = null, ease:Function = null)

Constructor. Specify basic information about the Tween.

Parameters
duration:Number — Duration of the tween (in seconds or frames).
 
type:uint (default = 0) — Tween type, one of Tween.PERSIST (default), Tween.LOOPING, or Tween.ONESHOT.
 
complete:Function (default = null) — Optional callback for when the Tween completes.
 
ease:Function (default = null) — Optional easer function to apply to the Tweened value.
Method Detail
cancel()method
public function cancel():void

Immediately stops the Tween and removes it from its Tweener without calling the complete callback.

start()method 
public function start():void

Starts the Tween, or restarts it if it's currently running.

update()method 
public function update():void

Updates the Tween, called by World.

Constant Detail
LOOPINGConstant
public static const LOOPING:uint = 1

Looping Tween type, will restart immediately when it finishes.

ONESHOTConstant 
public static const ONESHOT:uint = 2

Oneshot Tween type, will stop and remove itself from its core container when it finishes.

PERSISTConstant 
public static const PERSIST:uint = 0

Persistent Tween type, will stop when it finishes.