Packagegraphics.transitions
Classpublic class Tween
InheritanceTween Inheritance Motion Inheritance CoreTransition Inheritance CoreAction Inheritance Task Inheritance Object

The Tween class lets you use ActionScript to move, resize, and fade movie clips easily on the Stage by specifying a property of the target movie clip to be tween animated over a number of frames or seconds. The Tween class also lets you specify a variety of easing methods.

Easing refers to gradual acceleration or deceleration during an animation, which helps your animations appear more realistic.

Example :

     import graphics.transitions.Tween ;
     var tw:Tween = new Tween (mc, "_x", Elastic.easeOut, mc._x, 400, 2, true, true) ;
     



Public Properties
 PropertyDefined By
  buffer : *
Determinates the buffer reference of this Tween.
Tween
 InheritedchangeIt : Signaler
This signal emit when the notifyChanged method is invoked.
CoreAction
 InheritedclearIt : Signaler
This signal emit when the notifyCleared method is invoked.
CoreAction
 Inheritedduration : Number
Returns the duration of the tweened animation in frames or seconds.
Motion
 InheritedfinishIt : Signaler
This signal emit when the notifyFinished method is invoked.
Task
 Inheritedfps : Number
Returns the number of frames per second of the tweened animation.
Motion
 Inheritedid : *
Indicates the id value of this object.
CoreTransition
 InheritedinfoIt : Signaler
This signal emit when the notifyInfo method is invoked.
CoreAction
 Inheritedlogger : Logger
Determinates the internal Logger reference of this Loggable object.
Task
 Inheritedlooping : Boolean
The flag to determinate if the Action object is looped.
CoreAction
 InheritedloopIt : Signaler
This signal emit when the notifyLooped method is invoked.
CoreAction
 InheritedpauseIt : Signaler
This signal emit when the notifyPause method is invoked.
CoreAction
 Inheritedphase : String
[read-only] The current phase of the action.
Task
 InheritedprevTime : Number
Defined the internal prevTime value.
Motion
 InheritedprogressIt : Signaler
This signal emit when the notifyProgress method is invoked.
CoreAction
 InheritedresumeIt : Signaler
This signal emit when the notifyResumed method is invoked.
CoreAction
 Inheritedrunning : Boolean
[read-only] Indicates true if the process is in progress.
Task
 InheritedstartIt : Signaler
This signal emit when the notifyStarted method is invoked.
Task
 InheritedstopIt : Signaler
This signal emit when the notifyStopped method is invoked.
CoreAction
 Inheritedstopped : Boolean
[read-only] Indicates if the motion is stopped.
Motion
 Inheritedtarget : *
Indicates the target reference of the object contrains by the Motion effect.
Motion
 Inheritedtime : Number
[read-only] Indicates the current time within the duration of the animation.
Motion
 InheritedtimeoutIt : Signaler
This signal emit when the notifyTimeOut method is invoked.
CoreAction
 InheriteduseSeconds : Boolean
Defined if the Motion used seconds or not.
Motion
Public Methods
 MethodDefined By
  
Tween(... arguments)
Creates a new Tween instance.
Tween
  
add(entry:TweenEntry):void
Inserts a TweenEnry in the model of the Tween object.
Tween
  
addProperty(prop:String = null, easing:* = null, begin:Number, finish:Number):TweenEntry
Inserts a new property in the Tween object.
Tween
  
clear():void
Removes all entries in the model of this Tween object.
Tween
  
clone():*
[override] Returns a shallow copy of this Tween object.
Tween
 Inherited
equals(o:*):Boolean
Compares the specified object with this object for equality.
CoreTransition
 Inherited
isLocked():Boolean
Returns true if the object is locked.
Task
 Inherited
lock():void
Locks the object.
Task
 Inherited
nextFrame():void
Forwards the tweened animation to the next frame.
Motion
 Inherited
Notify when the process is changed.
CoreAction
 Inherited
Notify when the process is cleared.
CoreAction
 Inherited
Notify an ActionEvent when the process is finished.
Task
 Inherited
notifyInfo(info:*):void
Notify a specific information when the process is changed.
CoreAction
 Inherited
Notify when the process is looped.
CoreAction
 Inherited
Notify when the process is paused.
CoreAction
 Inherited
Notify when the process is in progress.
CoreAction
 Inherited
Notify when the process is resumed.
CoreAction
 Inherited
Notify an ActionEvent when the process is started.
Task
 Inherited
Notify when the process is stopped.
CoreAction
 Inherited
Notify when the process is out of time.
CoreAction
 Inherited
prevFrame():void
Directs the tweened animation to the frame previous to the current frame.
Motion
  
remove(entry:TweenEntry):Boolean
Remove a TweenEntry in the Tween Object.
Tween
  
removeProperty(prop:String):Boolean
Remove a property in the Tween Object.
Tween
 Inherited
resume():void
[override] Resumes a tweened animation from its stopped point in the animation.
Motion
 Inherited
rewind(t:Number = 0):void
Rewinds a tweened animation to the beginning of the tweened animation.
Motion
 Inherited
run(... arguments):void
[override] Runs the object.
Motion
 Inherited
setTime(t:Number):void
Sets the current time within the duration of the animation.
Motion
  
setTweenEntry(prop:String, easing:*, begin:Number, finish:Number):void
Set the TweenEntry property of this TweenLite object.
Tween
  
size():Number
Returns the numbers of elements(properties) in the model of this Tween.
Tween
 Inherited
start():void
[override] Starts the tweened animation from the beginning.
Motion
 Inherited
Starts the intenral interval of the tweened animation.
Motion
 Inherited
stop():void
[override] Stops the tweened animation at its current position.
Motion
 Inherited
Stops the intenral interval of the tweened animation.
Motion
 Inherited
unlock():void
Unlocks the display.
Task
  
update():void
[override] Update the current Tween in the time.
Tween
Protected Methods
 MethodDefined By
 Inherited
setRunning(b:Boolean):void
Changes the running property value.
Task
 Inherited
setTimer(timer:ITimer):void
Sets the internal timer of the tweened animation.
Motion
Property Detail
bufferproperty
buffer:*

Determinates the buffer reference of this Tween.


Implementation
    public function get buffer():*
    public function set buffer(value:any):void

See also

Constructor Detail
Tween()Constructor
public function Tween(... arguments)

Creates a new Tween instance.

Usage :

         var tw:Tween = new Tween( obj, prop:String, e: b:Number, f:Number, d:Number , u:Boolean, auto:Boolean ) ;
         var tw:Tween = new Tween( obj, entries:Array , d:Number , u:Boolean, auto:Boolean ) ;
         

Parameters
... arguments
Method Detail
add()method
public function add(entry:TweenEntry):void

Inserts a TweenEnry in the model of the Tween object.

Parameters

entry:TweenEntry — a TweenEntry reference.

addProperty()method 
public function addProperty(prop:String = null, easing:* = null, begin:Number, finish:Number):TweenEntry

Inserts a new property in the Tween object.

Parameters

prop:String (default = null) — the string representation of the number property.
 
easing:* (default = null) — the easing method used by the Tween on this property (use a Function or a Easing object).
 
begin:Number (default = NaN) — the begin value.
 
finish:Number (default = NaN) — the finish value.

Returns
TweenEntry — a TweenEntry defined by the specified arguments.
clear()method 
public function clear():void

Removes all entries in the model of this Tween object.

clone()method 
override public function clone():*

Returns a shallow copy of this Tween object.

Returns
* — a shallow copy of this Tween object.
remove()method 
public function remove(entry:TweenEntry):Boolean

Remove a TweenEntry in the Tween Object.

Parameters

entry:TweenEntry — The entry to remove in this Tween.

Returns
Boolean
removeProperty()method 
public function removeProperty(prop:String):Boolean

Remove a property in the Tween Object.

Parameters

prop:String

Returns
Boolean
setTweenEntry()method 
public function setTweenEntry(prop:String, easing:*, begin:Number, finish:Number):void

Set the TweenEntry property of this TweenLite object.

Parameters

prop:String — the property name of the object to change.
 
easing:* — the easing function of the tween entry (use a Function or a Easing object).
 
begin:Number — the begin value.
 
finish:Number — the finish value.

size()method 
public function size():Number

Returns the numbers of elements(properties) in the model of this Tween.

Returns
Number — the numbers of elements(properties) in the model of this Tween.
update()method 
override public function update():void

Update the current Tween in the time.