Packagepegas.transitions
Classpublic class Tween
InheritanceTween Inheritance Motion Inheritance Action Inheritance SimpleAction Inheritance CoreEventDispatcher Inheritance CoreObject

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 pegas.transitions.Tween ;
  var tw:Tween = new Tween (mc, "_x", Elastic.easeOut, mc._x, 400, 2, true, true) ;
  



Public Properties
 PropertyDefined by
 Inheritedchannel : String
Indicates the channel of this dispatcher if this instance is global.
CoreEventDispatcher
 Inheritedduration : Number
Returns the duration of the tweened animation in frames or seconds.
Motion
 Inheritedfps : Number
Returns the number of frames per second of the tweened animation.
Motion
 InheritedisGlobal : Boolean
(read-only) Returns the value of the isGlobal flag of this model.
CoreEventDispatcher
 Inheritedlooping : Boolean
The flag to determinate if the Action object is looped.
Action
  model : *
(read-write) Determinates the model of this Tween.
Tween
 InheritedprevTime : Number
Defined the internal prevTime value.
Motion
 Inheritedrunning : Boolean
(read-only) Indicates true if the process is in progress.
SimpleAction
 Inheritedtarget : *
Indicates the target reference of the object contrains by the Motion effect.
Motion
 Inheritedtime : Number
(read-only) Returns the current time within the duration of the animation.
Motion
 InheriteduseSeconds : Boolean
Defined if the Motion used seconds or not.
Motion
Public Methods
 MethodDefined by
  
Tween(... arguments)
Creates a new Tween instance.
Tween
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0.0, useWeakReference:Boolean = false):void
Allows the registration of event listeners on the event target.
CoreEventDispatcher
  
clear():void
Removes all entries in the model of this Tween object.
Tween
  
clone():*
Returns a shallow copy of this Tween object.
Tween
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
CoreEventDispatcher
 Inherited
Returns the internal EventDispatcher reference.
CoreEventDispatcher
 Inherited
Returns the event name use in the notifyChanged method.
Action
 Inherited
Returns the event name use in the notifyCleared method.
Action
 Inherited
Returns the event name use in the notifyInfo method.
Action
 Inherited
Returns the event name use in the notifyLooped method.
Action
 Inherited
Returns the event name use in the notifyProgress method.
Action
 Inherited
Returns the event name use in the notifyResumed method.
Action
 Inherited
Returns the event name use in the notifyStopped method.
Action
 Inherited
Returns the event name use in the notifyTimeOut method.
Action
 Inherited
getIsGlobal():Boolean
Returns the value of the isGlobal flag of this model.
CoreEventDispatcher
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
CoreEventDispatcher
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
 Inherited
Creates and returns the internal EventDispatcher reference (this method is invoked in the constructor).
CoreEventDispatcher
 Inherited
Initialize the internal event's types of this process.
Action
  
insert(entry:TweenEntry):void
Inserts a TweenEnry in the model of the Tween object.
Tween
  
insertProperty(prop:String = null, easing:Function = null, begin:Number, finish:Number):TweenEntry
Inserts a new property in the Tween object.
Tween
 Inherited
isLocked():Boolean
Returns true if the object is locked.
CoreEventDispatcher
 Inherited
lock():void
Locks the object.
CoreEventDispatcher
 Inherited
nextFrame(e:TimerEvent):void
Forwards the tweened animation to the next frame.
Motion
 Inherited
Notify an ActionEvent when the process is finished.
SimpleAction
 Inherited
Notify an ActionEvent when the process is started.
SimpleAction
 Inherited
prevFrame():void
Directs the tweened animation to the frame previous to the current frame.
Motion
 Inherited
registerEventListener(type:String, listener:Boolean, useCapture:int = false, priority:Boolean = 0, useWeakReference:* = false):void
Allows the registration of event listeners on the event target (Function or EventListener).
CoreEventDispatcher
  
remove(entry:TweenEntry):Boolean
Remove a TweenEntry in the Tween Object.
Tween
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
CoreEventDispatcher
  
removeProperty(prop:String):Boolean
Remove a property in the Tween Object.
Tween
 Inherited
resume():Boolean
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
Runs the object.
Motion
 Inherited
Sets the internal EventDispatcher reference.
CoreEventDispatcher
 Inherited
setEventTypeCHANGE(type:String):void
Sets the event name use in the notifyChanged method.
Action
 Inherited
setEventTypeCLEAR(type:String):void
Sets the event name use in the notifyCleared method.
Action
 Inherited
setEventTypeINFO(type:String):void
Sets the event name use in the notifyInfo method.
Action
 Inherited
setEventTypeLOOP(type:String):void
Sets the event name use in the notifyLooped method.
Action
 Inherited
setEventTypePROGRESS(type:String):void
Sets the event name use in the notifyProgress method.
Action
 Inherited
setEventTypeRESUME(type:String):void
Sets the event name use in the notifyResumed method.
Action
 Inherited
setEventTypeSTOP(type:String):void
Sets the event name use in the notifyStopped method.
Action
 Inherited
setEventTypeTIMEOUT(type:String):void
Sets the event name use in the notifyTimeOut method.
Action
 Inherited
setGlobal(flag:Boolean = false, channel:String = null):void
Sets if the instance use a global EventDispatcher to dispatch this events, if the flag value is false the instance use a local EventDispatcher.
CoreEventDispatcher
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
setTime(t:Number):void
Sets the current time within the duration of the animation.
Motion
 Inherited
setTimer(timer:ITimer):void
Sets the internal timer of the tweened animation.
Motion
  
setTweenEntry(prop:String, easing:Function, 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
Starts the tweened animation from the beginning.
Motion
 Inherited
Starts the intenral interval of the tweened animation.
Motion
 Inherited
stop(... args):*
Stops the tweened animation at its current position.
Motion
 Inherited
stopInterval():void
Stops the intenral interval of the tweened animation.
Motion
 Inherited
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
CoreEventDispatcher
 Inherited
toString():String
Returns the string representation of this instance.
CoreObject
 Inherited
unlock():void
Unlocks the display.
CoreEventDispatcher
 Inherited
unregisterEventListener(type:String, listener:Boolean, useCapture:* = false):void
Removes a listener (Function or EventListener object) from the EventDispatcher object.
CoreEventDispatcher
  
update():void
Update the current Tween in the time.
Tween
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
CoreEventDispatcher
Protected Methods
 MethodDefined by
 Inherited
fixTime():void
Motion
 Inherited
Notify an ActionEvent when the process is changed.
Action
 Inherited
Notify an ActionEvent when the process is cleared.
Action
 Inherited
notifyInfo(info:*):void
Notify an ActionEvent when the process info is changed.
Action
 Inherited
notifyLooped():void
Notify an ActionEvent when the process is looped.
Action
 Inherited
Notify an ActionEvent when the process is in progress.
Action
 Inherited
Notify an ActionEvent when the process is resumed.
Action
 Inherited
Notify an ActionEvent when the process is stopped.
Action
 Inherited
Notify an ActionEvent when the process is out of time.
Action
 Inherited
setRunning(b:Boolean):void
Changes the running property value.
SimpleAction
Events
 EventSummaryDefined by
 Inherited Dispatched when a process is changed.Action
 Inherited Dispatched when a process is cleared.Action
 Inherited Dispatched when a process is finished.SimpleAction
 Inherited Dispatched when an info process is running.Action
 Inherited Dispatched when a process is looped.Action
 Inherited Dispatched when a process is paused.Action
 Inherited Dispatched when a process is in progress.Action
 Inherited Dispatched when a process is resumed.Action
 Inherited Dispatched when a process is started.SimpleAction
 Inherited Dispatched when a process is stopped.Action
Property detail
modelproperty
model:*  [read-write]

(read-write) Determinates the model of this Tween.

Implementation
    public function get model():*
    public function set model(value:*):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:Function, b:Number, f:Number, d:Number , u:Boolean, auto:Boolean ) ;
    var tw:Tween = new Tween( obj, entries , d:Number , u:Boolean, auto:Boolean ) ;
    
Parameters
... arguments
Method detail
clear()method
public function clear():void

Removes all entries in the model of this Tween object.

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

Returns a shallow copy of this Tween object.

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

Inserts a TweenEnry in the model of the Tween object.

Parameters
entry:TweenEntry — a TweenEntry reference.
insertProperty()method 
public function insertProperty(prop:String = null, easing:Function = 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:Function (default = null) — the easing method used by the Tween on this property.
 
begin:Number — the begin value.
 
finish:Number — the finish value.

Returns
TweenEntry — a TweenEntry defined by the specified arguments.
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:Function, 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:Function — the easing function of the tween entry.
 
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 
public override function update():void

Update the current Tween in the time.