| Package | flare.animate |
| Class | public class Tween |
| Inheritance | Tween Transition flash.events.EventDispatcher |
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.
| Property | Defined by | ||
|---|---|---|---|
![]() | DEFAULT_EASING : Function [static] Default easing function: a cubic slow-in slow-out.
| Transition | |
![]() | delay : Number The delay between a call to play and the actual start
of the transition, in seconds.
| Transition | |
![]() | duration : Number The duration (length) of this Transition, in seconds.
| Transition | |
![]() | easing : Function Easing function used to pace this Transition.
| Transition | |
![]() | enabled : Boolean = true Flag indicating if step events should be processed.
| Transition | |
| from : Object Optional starting values for tweened properties.
| Tween | ||
![]() | id : String A unique name identifying this schedulable object.
| Transition | |
![]() | progress : 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 | ||
![]() | reverse : Boolean Indicates if this Transition is running in reverse.
| Transition | |
![]() | running : Boolean Indicates if this Transition is currently running.
| Transition | |
| target : Object The target object whose properties are tweened.
| Tween | ||
![]() | totalDuration : Number The total duration, including both delay and active duration.
| Transition | |
| values : Object The properties to tween and their target values.
| Tween | ||
| Method | Defined 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 | ||
![]() |
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 | ||
![]() |
evaluate(time:Number):Boolean
Evaluates the Transition, stepping the transition forward.
| Transition | |
![]() |
pause():void
Pauses the transition at its current position.
| Transition | |
![]() |
play(reverse:Boolean = false):void
Starts running the transition.
| Transition | |
![]() |
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 | ||
![]() |
stop():void
Stops the transition and completes it.
| Transition | |
| Method | Defined 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 | ||
| from | property |
from:Object [read-write]Optional starting values for tweened properties.
Implementation public function get from():Object
public function set from(value:Object):void
| remove | property |
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.
public function get remove():Boolean
public function set remove(value:Boolean):void
| target | property |
target:Object [read-write]The target object whose properties are tweened.
Implementation public function get target():Object
public function set target(value:Object):void
| values | property |
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
| 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.
Parameterstarget: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
|
| dispose | () | method |
public override function dispose():voidDisposes 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():voidEnds the tween, updating target object visibility and display list membership, if appropriate.
| setup | () | method |
protected override function setup():voidSets up this tween by creating interpolators for each tweened property.
| start | () | method |
protected override function start():voidUpdates target object visibility, if appropriate.
| step | () | method |
public override function step(ef:Number):voidSteps the tween, updating the tweened properties.
Parametersef:Number |