Packagecom.greensock.core
Classpublic class SimpleTimeline
InheritanceSimpleTimeline Inheritance Animation Inheritance Object
Subclasses TimelineLite

SimpleTimeline is the base class for TimelineLite and TimelineMax, providing the most basic timeline functionality and it is used for the root timelines in TweenLite but is only intended for internal use in the GreenSock tweening platform. It is meant to be very fast and lightweight.

Copyright 2008-2013, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for Club GreenSock members, the software agreement that was issued with the membership.



Public Properties
 PropertyDefined By
  autoRemoveChildren : Boolean
If true, child tweens/timelines will be removed as soon as they complete.
SimpleTimeline
 Inheriteddata : *
A place to store any data you want (initially populated with vars.data if it exists).
Animation
  smoothChildTiming : Boolean
Controls whether or not child tweens/timelines are repositioned automatically (changing their startTime) in order to maintain smooth playback when properties are changed on-the-fly.
SimpleTimeline
 Inheritedticker : Shape
[static] The object that dispatches a "tick" event each time the engine updates, making it easy for you to add your own listener(s) to run custom logic after each update (great for game developers).
Animation
 Inheritedtimeline : SimpleTimeline
[Read-only] Parent timeline.
Animation
 Inheritedvars : Object
The vars object passed into the constructor which stores configuration variables like onComplete, onUpdate, etc.
Animation
Public Methods
 MethodDefined By
  
SimpleTimeline(vars:Object = null)
Constructor
SimpleTimeline
  
add(child:*, position:* = +=0, align:String = normal, stagger:Number = 0):*
Adds a TweenLite, TweenMax, TimelineLite, or TimelineMax instance to the timeline at a specific time.
SimpleTimeline
 Inherited
delay(value:Number):*
Gets or sets the animation's initial delay which is the length of time in seconds (or frames for frames-based tweens) before the animation should begin.
Animation
 Inherited
duration(value:Number):*
Gets or sets the animation's duration, not including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax).
Animation
 Inherited
eventCallback(type:String, callback:Function = null, params:Array = null):*
Gets or sets an event callback like "onComplete", "onUpdate", "onStart", "onReverseComplete" or "onRepeat" (onRepeat only applies to TweenMax or TimelineMax instances) along with any parameters that should be passed to that callback.
Animation
 Inherited
Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values.
Animation
 Inherited
isActive():Boolean
Indicates whether or not the animation is currently active (meaning the virtual playhead is actively moving across this instance's time span and it is not paused, nor are any of its ancestor timelines).
Animation
 Inherited
kill(vars:Object = null, target:Object = null):*
Kills the animation entirely or in part depending on the parameters.
Animation
 Inherited
pause(atTime:* = null, suppressEvents:Boolean = true):*
Pauses the instance, optionally jumping to a specific time.
Animation
 Inherited
paused(value:Boolean = false):*
Gets or sets the animation's paused state which indicates whether or not the animation is currently paused.
Animation
 Inherited
play(from:* = null, suppressEvents:Boolean = true):*
Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is).
Animation
 Inherited
progress(value:Number, suppressEvents:Boolean = false):*
Gets or sets the animations's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete).
Animation
  
render(time:Number, suppressEvents:Boolean = false, force:Boolean = false):void
[override]
SimpleTimeline
 Inherited
restart(includeDelay:Boolean = false, suppressEvents:Boolean = true):*
Restarts and begins playing forward from the beginning.
Animation
 Inherited
resume(from:* = null, suppressEvents:Boolean = true):*
Resumes playing without altering direction (forward or reversed), optionally jumping to a specific time first.
Animation
 Inherited
reverse(from:* = null, suppressEvents:Boolean = true):*
Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease.
Animation
 Inherited
reversed(value:Boolean = false):*
Gets or sets the animation's reversed state which indicates whether or not the animation should be played backwards.
Animation
 Inherited
seek(time:*, suppressEvents:Boolean = true):*
Jumps to a specific time without affecting whether or not the instance is paused or reversed.
Animation
 Inherited
startTime(value:Number):*
Gets or sets the time at which the animation begins on its parent timeline (after any delay that was defined).
Animation
 Inherited
time(value:Number, suppressEvents:Boolean = false):*
Gets or sets the local position of the playhead (essentially the current time), described in seconds (or frames for frames-based animations) which will never be less than 0 or greater than the animation's duration.
Animation
 Inherited
timeScale(value:Number):*
Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc.
Animation
 Inherited
totalDuration(value:Number):*
Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax).
Animation
 Inherited
totalProgress(value:Number, suppressEvents:Boolean = false):*
Gets or sets the animation's total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete).
Animation
 Inherited
totalTime(time:Number, suppressEvents:Boolean = false, uncapped:Boolean = false):*
Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays (only available in TweenMax and TimelineMax).
Animation
Property Detail
autoRemoveChildrenproperty
public var autoRemoveChildren:Boolean

If true, child tweens/timelines will be removed as soon as they complete. (false by default except on the root timeline(s))

smoothChildTimingproperty 
public var smoothChildTiming:Boolean

Controls whether or not child tweens/timelines are repositioned automatically (changing their startTime) in order to maintain smooth playback when properties are changed on-the-fly. For example, imagine that the timeline's playhead is on a child tween that is 75% complete, moving mc.x from 0 to 100 and then that tween's reverse() method is called. If smoothChildTiming is false (the default except for the root timelines), the tween would flip in place, keeping its startTime consistent. Therefore the playhead of the timeline would now be at the tween's 25% completion point instead of 75%. Remember, the timeline's playhead position and direction are unaffected by child tween/timeline changes. mc.x would jump from 75 to 25, but the tween's position in the timeline would remain consistent. However, if smoothChildTiming is true, that child tween's startTime would be adjusted so that the timeline's playhead intersects with the same spot on the tween (75% complete) as it had immediately before reverse() was called, thus playback appears perfectly smooth. mc.x would still be 75 and it would continue from there as the playhead moves on, but since the tween is reversed now mc.x will travel back towards 0 instead of 100. Ultimately it's a decision between prioritizing smooth on-the-fly playback (true) or consistent position(s) of child tweens/timelines (false).

Some examples of on-the-fly changes to child tweens/timelines that could cause their startTime to change when smoothChildTiming is true are: reversed, timeScale, progress, totalProgress, time, totalTime, delay, pause, resume, duration, and totalDuration.

Constructor Detail
SimpleTimeline()Constructor
public function SimpleTimeline(vars:Object = null)

Constructor

Parameters
vars:Object (default = null) — Object containing configuration variables like onComplete, onUpdate, onStart, data, etc.
Method Detail
add()method
public function add(child:*, position:* = +=0, align:String = normal, stagger:Number = 0):*

Adds a TweenLite, TweenMax, TimelineLite, or TimelineMax instance to the timeline at a specific time. In classes like TimelineLite and TimelineMax that override this method, it allows things like callbacks, labels, and arrays of tweens/timelines/callbacks/labels to be inserted too. They also allow the position to be defined in terms of either a numeric time or a label (String).

Parameters

child:* — TweenLite, TweenMax, TimelineLite, or TimelineMax instance to insert
 
position:* (default = +=0) — The position at which the tween/timeline should be inserted which can be expressed as a number (for an absolute time as seconds or frames for frames-based timelines) or a string, using "+=" or "-=" prefix to indicate a relative value (relative to the END of the timeline). For example, myTimeline.insert(myTween, 3) would insert myTween 3 seconds into the timeline.
 
align:String (default = normal) — Determines how the tweens/timelines/callbacks/labels will be aligned in relation to each other before getting inserted. Options are: "sequence" (aligns them one-after-the-other in a sequence), "start" (aligns the start times of all of the objects (ignoring delays)), and "normal" (aligns the start times of all the tweens (honoring delays)). The default is "normal".
 
stagger:Number (default = 0) — Staggers the inserted objects by a set amount of time (in seconds) (or in frames for frames-based timelines). For example, if the stagger value is 0.5 and the "align" parameter is set to "start", the second one will start 0.5 seconds after the first one starts, then 0.5 seconds later the third one will start, etc. If the align property is "sequence", there would be 0.5 seconds added between each tween. Default is 0.

Returns
* — this timeline instance (useful for chaining like myTimeline.add(...).add(...))
render()method 
override public function render(time:Number, suppressEvents:Boolean = false, force:Boolean = false):void

Parameters

time:Number
 
suppressEvents:Boolean (default = false)
 
force:Boolean (default = false)