| Package | pegas.transitions |
| Class | public class TweenLite |
| Inheritance | TweenLite Motion Action SimpleAction CoreEventDispatcher CoreObject |
Easing refers to gradual acceleration or deceleration during an animation, which helps your animations appear more realistic.
Example :
import pegas.process.ActionEvent ;
import pegas.transitions.TweenLite ;
import pegas.transitions.easing.Back ;
var debug:Function = function( ev:ActionEvent ):void
{
trace (":: debug -> " + ev.type + " : " + ev.target ) ;
}
var tw:TweenLite = new TweenLite (mc, "x", Back.easeOut, mc.x, 400, 2, true, true) ;
tw.looping = true ;
tw.addEventListener( ActionEvent.START , debug ) ;
tw.addEventListener( ActionEvent.PROGRESS , debug ) ;
tw.addEventListener( ActionEvent.FINISH , debug ) ;
tw.addEventListener( ActionEvent.LOOP , debug ) ;
| Property | Defined by | ||
|---|---|---|---|
![]() | channel : String
Indicates the channel of this dispatcher if this instance is global.
| CoreEventDispatcher | |
![]() | duration : Number
Returns the duration of the tweened animation in frames or seconds.
| Motion | |
![]() | fps : Number
Returns the number of frames per second of the tweened animation.
| Motion | |
![]() | isGlobal : Boolean
(read-only) Returns the value of the isGlobal flag of this model.
| CoreEventDispatcher | |
![]() | looping : Boolean
The flag to determinate if the Action object is looped.
| Action | |
![]() | prevTime : Number
Defined the internal prevTime value.
| Motion | |
![]() | running : Boolean
(read-only) Indicates
true if the process is in progress. | SimpleAction | |
![]() | target : *
Indicates the target reference of the object contrains by the Motion effect.
| Motion | |
![]() | time : Number
(read-only) Returns the current time within the duration of the animation.
| Motion | |
| tweenEntry : TweenEntry
(read-write) The TweenEntry reference of this tween.
| TweenLite | ||
![]() | useSeconds : Boolean
Defined if the Motion used seconds or not.
| Motion | |
| Method | Defined by | ||
|---|---|---|---|
|
TweenLite(obj:* = null, prop:String = null, easing:Function = null, begin:Number, finish:Number, duration:Number = 0, useSeconds:Boolean = false, auto:Boolean = false, bGlobal:Boolean = false, sChannel:String = null)
Creates a new Motion instance.
| TweenLite | ||
![]() |
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 | |
|
clone():*
Returns a shallow copy of this Tween object.
| TweenLite | ||
|
continueTo(finish:Number, duration:Number, noRestart:Boolean = false):void
Instructs the tweened animation to continue tweening from its current animation point to a new finish and duration point.
| TweenLite | ||
![]() |
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
| CoreEventDispatcher | |
![]() |
Returns the internal
EventDispatcher reference. | CoreEventDispatcher | |
![]() |
getEventTypeCHANGE():String
Returns the event name use in the notifyChanged method.
| Action | |
![]() |
getEventTypeCLEAR():String
Returns the event name use in the notifyCleared method.
| Action | |
![]() |
getEventTypeINFO():String
Returns the event name use in the notifyInfo method.
| Action | |
![]() |
getEventTypeLOOP():String
Returns the event name use in the notifyLooped method.
| Action | |
![]() |
getEventTypePROGRESS():String
Returns the event name use in the notifyProgress method.
| Action | |
![]() |
getEventTypeRESUME():String
Returns the event name use in the notifyResumed method.
| Action | |
![]() |
getEventTypeSTOP():String
Returns the event name use in the notifyStopped method.
| Action | |
![]() |
getEventTypeTIMEOUT():String
Returns the event name use in the notifyTimeOut method.
| Action | |
![]() |
getIsGlobal():Boolean
Returns the value of the isGlobal flag of this model.
| CoreEventDispatcher | |
![]() |
Returns the internal
ILogger reference of this ILogable object. | CoreObject | |
![]() |
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
| CoreEventDispatcher | |
![]() |
hashCode():uint
Returns a hashcode value for the object.
| CoreObject | |
![]() |
Creates and returns the internal
EventDispatcher reference (this method is invoked in the constructor). | CoreEventDispatcher | |
![]() |
initEventType():void
Initialize the internal event's types of this process.
| Action | |
![]() |
isLocked():Boolean
Returns
true if the object is locked. | CoreEventDispatcher | |
![]() |
lock():void
Locks the object.
| CoreEventDispatcher | |
![]() |
nextFrame(e:TimerEvent):void
Forwards the tweened animation to the next frame.
| Motion | |
![]() |
notifyFinished():void
Notify an ActionEvent when the process is finished.
| SimpleAction | |
![]() |
notifyStarted():void
Notify an ActionEvent when the process is started.
| SimpleAction | |
![]() |
prevFrame():void
Directs the tweened animation to the frame previous to the current frame.
| Motion | |
![]() |
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 | |
![]() |
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
| CoreEventDispatcher | |
![]() |
resume():Boolean
Resumes a tweened animation from its stopped point in the animation.
| Motion | |
![]() |
rewind(t:Number = 0):void
Rewinds a tweened animation to the beginning of the tweened animation.
| Motion | |
![]() |
run(... arguments):void
Runs the object.
| Motion | |
![]() |
setEventDispatcher(e:EventDispatcher):void
Sets the internal
EventDispatcher reference. | CoreEventDispatcher | |
![]() |
setEventTypeCHANGE(type:String):void
Sets the event name use in the notifyChanged method.
| Action | |
![]() |
setEventTypeCLEAR(type:String):void
Sets the event name use in the notifyCleared method.
| Action | |
![]() |
setEventTypeINFO(type:String):void
Sets the event name use in the notifyInfo method.
| Action | |
![]() |
setEventTypeLOOP(type:String):void
Sets the event name use in the notifyLooped method.
| Action | |
![]() |
setEventTypePROGRESS(type:String):void
Sets the event name use in the notifyProgress method.
| Action | |
![]() |
setEventTypeRESUME(type:String):void
Sets the event name use in the notifyResumed method.
| Action | |
![]() |
setEventTypeSTOP(type:String):void
Sets the event name use in the notifyStopped method.
| Action | |
![]() |
setEventTypeTIMEOUT(type:String):void
Sets the event name use in the notifyTimeOut method.
| Action | |
![]() |
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 | |
![]() |
Sets the internal
ILogger reference of this ILogable object. | CoreObject | |
![]() |
setTime(t:Number):void
Sets the current time within the duration of the animation.
| Motion | |
![]() |
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.
| TweenLite | ||
![]() |
start():void
Starts the tweened animation from the beginning.
| Motion | |
![]() |
startInterval():void
Starts the intenral interval of the tweened animation.
| Motion | |
![]() |
stop(... args):*
Stops the tweened animation at its current position.
| Motion | |
![]() |
stopInterval():void
Stops the intenral interval of the tweened animation.
| Motion | |
![]() |
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
| CoreEventDispatcher | |
![]() |
toString():String
Returns the string representation of this instance.
| CoreObject | |
![]() |
unlock():void
Unlocks the display.
| CoreEventDispatcher | |
![]() |
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.
| TweenLite | ||
![]() |
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 | |
|
yoyo():void
Instructs the tweened animation to play in reverse from its last direction of tweened property increments.
| TweenLite | ||
| tweenEntry | property |
tweenEntry:TweenEntry [read-write](read-write) The TweenEntry reference of this tween.
Example :
import pegas.transitions.TweenEntry ; import pegas.transitions.TweenLite ; import pegas.transitions.easing.Bounce ; var tw:TweenLite = new TweenLite( mc ) ; tw.duration = 1 ; tw.useSeconds = true ; tw.tweenEntry = new TweenEntry( "x" , Bounce.easeOut, mc.x , 500 ) ; tw.start() ;Implementation
public function get tweenEntry():TweenEntry
public function set tweenEntry(value:TweenEntry):void
| TweenLite | () | constructor |
public function TweenLite(obj:* = null, prop:String = null, easing:Function = null, begin:Number, finish:Number, duration:Number = 0, useSeconds:Boolean = false, auto:Boolean = false, bGlobal:Boolean = false, sChannel:String = null)Creates a new Motion instance.
Parametersobj:* (default = null) — the flag to use a global event flow or a local event flow.
|
|
prop:String (default = null) — the name of the global event flow if the bGlobal argument is true.
|
|
easing:Function (default = null) |
|
begin:Number |
|
finish:Number |
|
duration:Number (default = 0) |
|
useSeconds:Boolean (default = false) |
|
auto:Boolean (default = false) |
|
bGlobal:Boolean (default = false) |
|
sChannel:String (default = null) |
| clone | () | method |
public override function clone():*Returns a shallow copy of this Tween object.
Returns* — a shallow copy of this Tween object.
|
| continueTo | () | method |
public function continueTo(finish:Number, duration:Number, noRestart:Boolean = false):voidInstructs the tweened animation to continue tweening from its current animation point to a new finish and duration point.
Example :
import pegas.events.ActionEvent ;
import pegas.transitions.TweenLite ;
import pegas.transitions.easing.Bounce ;
var continueTo:Function = function( e:ActionEvent ):void
{
tw.removeEventListener( ActionEvent.FINISH , continueTo ) ;
var target:TweenLite = e.target as TweenLite ;
trace(e + " continueTo(100,2)" ) ;
target.continueTo( 100 , 3 ) ;
}
var tw:TweenLite = new TweenLite( mc, "x", Bounce.easeOut, mc.x, 550, 1, true ) ;
tw.addEventListener( ActionEvent.FINISH , continueTo ) ;
tw.run() ;
Parameters
finish:Number — A number indicating the ending value of the target object property that is to be tweened.
|
|
duration:Number — A number indicating the length of time or number of frames for the tween motion.
|
|
noRestart:Boolean (default = false) — This optional flag is used to fix the restart process of the tween.
|
| setTweenEntry | () | method |
public function setTweenEntry(prop:String, easing:Function, begin:Number, finish:Number):voidSet the TweenEntry property of this TweenLite object.
Parametersprop: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.
|
| update | () | method |
public override function update():voidUpdate the current Tween in the time.
| yoyo | () | method |
public function yoyo():voidInstructs the tweened animation to play in reverse from its last direction of tweened property increments. If this method is called before a Tween object's animation is complete, the animation abruptly jumps to the end of its play and then plays in a reverse direction from that point.
Example :
import pegas.events.ActionEvent ;
import pegas.transitions.TweenLite ;
import pegas.transitions.easing.Bounce ;
var yoyo:Function = function( e:ActionEvent ):void
{
var target:TweenLite = e.target as TweenLite ;
trace(e + " yoyo()" ) ;
target.yoyo() ;
}
var tw:TweenLite = new TweenLite( mc, "x", Bounce.easeOut, mc.x, 550, 2, true ) ;
tw.addEventListener( ActionEvent.FINISH , yoyo ) ;
tw.run() ;