Packageflare.animate
Classpublic class Tween
InheritanceTween Inheritance Transition Inheritance flash.events.EventDispatcher

Transition that interpolates (in-betweens) properties of a target object over a time interval. The values property represents the set of properties to tween and their final values. Any arbitrary property (not just visual properties) can be tweened. The Tween class handles tweening of Numbers, colors, Dates, Points, Rectangles, and numeric Arrays. Properties of other types are simply swapped when then Transition half-completes. Tweening for custom types is possible, see the flare.animate.interpolate.Interpolator class for more.

Starting values are automatically determined from the tweened object. Once determined, these starting values are stored to allow both forward and backward playback. Use the reset method to force a tween to redetermine the starting values the next time it is played. Tweens also provide a remove flag for DisplayObjects. When set to true, a display object will be removed from the display list at the end of the tween. Note that playing the tween is reverse will not revert this removal.

Internally, a Tween creates a set of Interpolator objects to compute intermediate values for each property included in values. Note that property names can involve nested properties. For example, {"filters[0].blurX":5} is a valid tweening property, as both array access ([]) and property access (.) syntax are supported.

To manage a collection of objects being tweened simultaneously, use a Transitioner object.



Public Properties
 PropertyDefined by
 InheritedDEFAULT_EASING : Function
[static] Default easing function: a cubic slow-in slow-out.
Transition
 Inheriteddelay : Number
The delay between a call to play and the actual start of the transition, in seconds.
Transition
 Inheritedduration : Number
The duration (length) of this Transition, in seconds.
Transition
 Inheritedeasing : Function
Easing function used to pace this Transition.
Transition
 Inheritedenabled : Boolean = true
Flag indicating if step events should be processed.
Transition
  from : Object
Optional starting values for tweened properties.
Tween
 Inheritedid : String
A unique name identifying this schedulable object.
Transition
 Inheritedprogress : Number
Fraction between 0 and 1 indicating the current progress of this transition.
Transition
  remove : Boolean
Flag indicating if the target object should be removed from the display list at the end of the tween.
Tween
 Inheritedreverse : Boolean
Indicates if this Transition is running in reverse.
Transition
 Inheritedrunning : Boolean
Indicates if this Transition is currently running.
Transition
  target : Object
The target object whose properties are tweened.
Tween
 InheritedtotalDuration : Number
The total duration, including both delay and active duration.
Transition
  values : Object
The properties to tween and their target values.
Tween
Protected Properties
 PropertyDefined by
 Inherited_reverse : Boolean = false
Flag indicating this Transition is running in reverse.
Transition
 Inherited_running : Boolean = false
Flag indicating this Transition is currently running.
Transition
Public Methods
 MethodDefined by
  
Tween(target:Object, duration:Number = 1, values:Object = null, remove:Boolean = false, easing:Function = null)
Creates a new Tween with the specified parameters.
Tween
 Inherited
cancelled():void
Informs this transition that it was cancelled by the scheduler.
Transition
  
dispose():void
Disposes of this transition, freeing up any resources held.
Tween
 Inherited
evaluate(time:Number):Boolean
Evaluates the Transition, stepping the transition forward.
Transition
 Inherited
pause():void
Pauses the transition at its current position.
Transition
 Inherited
play(reverse:Boolean = false):void
Starts running the transition.
Transition
 Inherited
reset():void
Resets the transition, so that any cached starting values are cleared and reset the next time this transition is played.
Transition
  
step(ef:Number):void
Steps the tween, updating the tweened properties.
Tween
 Inherited
stop():void
Stops the transition and completes it.
Transition
Protected Methods
 MethodDefined by
  
end():void
Ends the tween, updating target object visibility and display list membership, if appropriate.
Tween
  
setup():void
Sets up this tween by creating interpolators for each tweened property.
Tween
  
start():void
Updates target object visibility, if appropriate.
Tween
Events
 EventSummaryDefined by
 Inherited  Transition
 Inherited
end
 Transition
 Inherited  Transition
 Inherited  Transition
Protected Constants
 ConstantDefined by
 InheritedINIT : int = 1
[static] Constant indicating this Transition has been initialized.
Transition
 InheritedRUN : int = 2
[static] Constant indicating this Transition is currently running.
Transition
 InheritedSETUP : int = 0
[static] Constant indicating this Transition needs initialization.
Transition
Property detail
fromproperty
from:Object  [read-write]

Optional starting values for tweened properties.

Implementation
    public function get from():Object
    public function set from(value:Object):void
removeproperty 
remove:Boolean  [read-write]

Flag indicating if the target object should be removed from the display list at the end of the tween. Only applies when the target is a DisplayObject.

Implementation
    public function get remove():Boolean
    public function set remove(value:Boolean):void
targetproperty 
target:Object  [read-write]

The target object whose properties are tweened.

Implementation
    public function get target():Object
    public function set target(value:Object):void
valuesproperty 
values:Object  [read-write]

The properties to tween and their target values.

Implementation
    public function get values():Object
    public function set values(value:Object):void
Constructor detail
Tween()constructor
public function Tween(target:Object, duration:Number = 1, values:Object = null, remove:Boolean = false, easing:Function = null)

Creates a new Tween with the specified parameters.

Parameters
target:Object — the target object
 
duration:Number (default = 1) — the duration of the tween, in seconds
 
values:Object (default = null) — the properties to tween and their target values
 
remove:Boolean (default = false) — a display list removal flag (for DisplayObject target objects
 
easing:Function (default = null) — the easing function to use
Method detail
dispose()method
public override function dispose():void

Disposes of this transition, freeing up any resources held. This method is optional, but calling it when a transition is no longer needed can help improve overall performance.

end()method 
protected override function end():void

Ends the tween, updating target object visibility and display list membership, if appropriate.

setup()method 
protected override function setup():void

Sets up this tween by creating interpolators for each tweened property.

start()method 
protected override function start():void

Updates target object visibility, if appropriate.

step()method 
public override function step(ef:Number):void

Steps the tween, updating the tweened properties.

Parameters
ef:Number