Package | com.greensock |
Class | public class TimelineLite |
Inheritance | TimelineLite SimpleTimeline TweenCore |
Subclasses | TimelineMax |
currentProgress
property. For example, to skip to
the halfway point, set myTimeline.currentProgress = 0.5
. currentTime
or currentProgress
property to fastforward/rewind
the timeline. You could even attach a slider to one of these properties to give the user the ability
to drag forwards/backwards through the timeline.
import com.greensock.TweenLite;
import com.greensock.TweenMax;
import com.greensock.TimelineLite;
//create the timeline and add an onComplete callback that will call myFunction() when the timeline completes
var myTimeline:TimelineLite = new TimelineLite({onComplete:myFunction});
//add a tween
myTimeline.append(new TweenLite(mc, 1, {x:200, y:100}));
//add another tween at the end of the timeline (makes sequencing easy)
myTimeline.append(new TweenLite(mc, 0.5, {alpha:0}));
//reverse anytime
myTimeline.reverse();
//Add a "spin" label 3-seconds into the timeline
myTimeline.addLabel("spin", 3);
//insert a rotation tween at the "spin" label (you could also define the insert point as the time instead of a label)
myTimeline.insert(new TweenLite(mc, 2, {rotation:"360"}), "spin");
//go to the "spin" label and play the timeline from there
myTimeline.gotoAndPlay("spin");
//add a tween to the beginning of the timeline, pushing all the other existing tweens back in time
myTimeline.prepend(new TweenMax(mc, 1, {tint:0xFF0000}));
//nest another TimelineLite inside your timeline...
var nestedTimeline:TimelineLite = new TimelineLite();
nestedTimeline.append(new TweenLite(mc2, 1, {x:200}));
myTimeline.append(nestedTimeline);
insertMultiple() and appendMultiple() provide some very powerful sequencing tools, allowing you to add an Array of
tweens or timelines and optionally align them with SEQUENCE or START modes, and even stagger them if you want.
For example, to insert 3 tweens into the timeline, aligning their start times but staggering them by 0.2 seconds,
myTimeline.insertMultiple([new TweenLite(mc, 1, {y:"100"}),
new TweenLite(mc2, 1, {x:20}),
new TweenLite(mc3, 1, {alpha:0.5})],
0,
TweenAlign.START,
0.2);
var myTimeline:TimelineLite = new TimelineLite({tweens:[new TweenLite(mc1, 1, {y:"100"}), TweenMax.to(mc2, 1, {tint:0xFF0000})], align:TweenAlign.SEQUENCE, onComplete:myFunction});
AUTO
, but you can set it to whatever you want with OverwriteManager.init()
(see http://blog.greensock.com/overwritemanager/)Property | Defined by | ||
---|---|---|---|
autoRemoveChildren : Boolean If a timeline's autoRemoveChildren is true, its children will be removed and made eligible for garbage collection as soon as they complete.
| SimpleTimeline | ||
currentProgress : Number
Value between 0 and 1 indicating the progress of the timeline according to its duration
where 0 is at the beginning, 0.5 is halfway finished, and 1 is finished.
| TimelineLite | ||
currentTime : Number
Most recently rendered time (or frame for frames-based tweens/timelines) according to its
duration . | TweenCore | ||
data : * Place to store any data you want.
| TweenCore | ||
delay : Number
Length of time in seconds (or frames for frames-based tweens/timelines) before the tween should begin.
| TweenCore | ||
duration : Number
Duration of the timeline in seconds (or frames for frames-based timelines) not including any repeats
or repeatDelays.
| TimelineLite | ||
paused : Boolean Indicates the paused state of the tween/timeline.
| TweenCore | ||
reversed : Boolean Indicates the reversed state of the tween/timeline.
| TweenCore | ||
startTime : Number Start time in seconds (or frames for frames-based tweens/timelines), according to its position on its parent timeline
| TweenCore | ||
timeline : SimpleTimeline
The parent timeline on which the tween/timeline is placed.
| TweenCore | ||
timeScale : Number Multiplier describing the speed of the timeline where 1 is normal speed, 0.5 is half-speed, 2 is double speed, etc.
| TimelineLite | ||
totalDuration : Number
Duration of the timeline in seconds (or frames for frames-based timelines) including any repeats
or repeatDelays.
| TimelineLite | ||
totalTime : Number
Most recently rendered time (or frame for frames-based tweens/timelines) according to its
totalDuration . | TweenCore | ||
useFrames : Boolean [read-only]
Indicates whether or not the timeline's timing mode is frames-based as opposed to time-based.
| TimelineLite | ||
vars : Object Stores variables (things like alpha, y or whatever we're tweening as well as special properties like "onComplete").
| TweenCore |
Method | Defined by | ||
---|---|---|---|
TimelineLite(vars:Object = null)
Constructor.
| TimelineLite | ||
addLabel(label:String, time:Number):void
Adds a label to the timeline, making it easy to mark important positions/times.
| TimelineLite | ||
Inserts a TweenLite, TweenMax, TimelineLite, or TimelineMax instance at the end of the timeline,
optionally offsetting its insertion point by a certain amount (to make it overlap with the end of
the timeline or leave a gap before its insertion point).
| TimelineLite | ||
appendMultiple(tweens:Array, offset:Number = 0, align:String = "normal", stagger:Number = 0):void
Appends multiple tweens/timelines at the end of the timeline at once, optionally offsetting the insertion point by a certain amount,
aligning them (as a sequence for example), and/or staggering their relative timing.
| TimelineLite | ||
clear(tweens:Array = null):void
Empties the timeline of all child tweens/timelines, or you can optionally pass an Array containing specific
tweens/timelines to remove.
| TimelineLite | ||
complete(skipRender:Boolean = false, suppressEvents:Boolean = false):void
Forces the tween/timeline to completion.
| TweenCore | ||
getChildren(nested:Boolean = true, tweens:Boolean = true, timelines:Boolean = true, ignoreBeforeTime:Number = -9999999999):Array
Provides an easy way to get all of the tweens and/or timelines nested in this timeline (as an Array).
| TimelineLite | ||
getLabelTime(label:String):Number
Returns the time associated with a particular label.
| TimelineLite | ||
getTweensOf(target:Object, nested:Boolean = true):Array
Returns the tweens of a particular object that are inside this timeline.
| TimelineLite | ||
goto(timeOrLabel:*, suppressEvents:Boolean = true):void
Skips to a particular time, frame, or label without changing the paused state of the timeline
| TimelineLite | ||
gotoAndPlay(timeOrLabel:*, suppressEvents:Boolean = true):void
Skips to a particular time, frame, or label and plays the timeline forwards from there (unpausing it)
| TimelineLite | ||
gotoAndStop(timeOrLabel:*, suppressEvents:Boolean = true):void
Skips to a particular time, frame, or label and stops the timeline (pausing it)
| TimelineLite | ||
Inserts a TweenLite, TweenMax, TimelineLite, or TimelineMax instance into the timeline at a specific time, frame, or label.
| TimelineLite | ||
insertMultiple(tweens:Array, timeOrLabel:String = "0", align:Number = normal, stagger:* = 0):void
Inserts multiple tweens/timelines into the timeline at once, optionally aligning them (as a sequence for example)
and/or staggering the timing.
| TimelineLite | ||
invalidate():void
Clears any initialization data (like starting values in tweens) which can be useful if, for example,
you want to restart it without reverting to any previously recorded starting values.
| TimelineLite | ||
kill():void
Kills the tween/timeline, stopping it immediately.
| TweenCore | ||
killTweensOf(target:Object, nested:Boolean = true):Boolean
Kills tweens of a particular object.
| TimelineLite | ||
pause():void
Pauses the tween/timeline
| TweenCore | ||
play():void
Starts playing forward from the current position.
| TweenCore | ||
Inserts a TweenLite, TweenMax, TimelineLite, or TimelineMax instance at the beginning of the timeline,
pushing all existing tweens back in time to make room for the newly inserted one.
| TimelineLite | ||
prependMultiple(tweens:Array, align:String = "normal", stagger:Number = 0, adjustLabels:Boolean = false):void
Prepends multiple tweens/timelines to the beginning of the timeline at once, moving all existing children back to make
room, and optionally aligning the new children (as a sequence for example) and/or staggering the timing.
| TimelineLite | ||
Removes a TweenLite, TweenMax, TimelineLite, or TimelineMax instance from the timeline.
| TimelineLite | ||
restart(includeDelay:Boolean = false, suppressEvents:Boolean = true):void
Restarts and begins playing forward.
| TweenCore | ||
resume():void
Starts playing from the current position without altering direction (forward or reversed).
| TweenCore | ||
reverse(forceResume:Boolean = true):void
Reverses smoothly, adjusting the startTime to avoid any skipping.
| TweenCore | ||
shiftChildren(amount:Number, adjustLabels:Boolean = false, ignoreBeforeTime:Number = 0):void
Shifts the startTime of the timeline's children by a certain amount and optionally adjusts labels too.
| TimelineLite | ||
stop():void
Pauses the timeline (same as pause() - added stop() for consistency with Flash's MovieClip.stop() functionality)
| TimelineLite |
currentProgress | property |
currentProgress:Number
[read-write]
Value between 0 and 1 indicating the progress of the timeline according to its duration
where 0 is at the beginning, 0.5 is halfway finished, and 1 is finished. totalProgress
,
by contrast, describes the overall progress according to the timeline's totalDuration
which includes repeats and repeatDelays (if there are any). Since TimelineLite doesn't offer
"repeat" and "repeatDelay" functionality, currentProgress
and totalProgress
are always the same
but in TimelineMax, they could be different. For example, if a TimelineMax instance
is set to repeat once, at the end of the first cycle totalProgress
would only be 0.5
whereas currentProgress
would be 1. If you tracked both properties over the course of the
tween, you'd see currentProgress
go from 0 to 1 twice (once for each cycle) in the same
time it takes the totalProgress
property to go from 0 to 1 once.
public function get currentProgress():Number
public function set currentProgress(value:Number):void
duration | property |
duration:Number
[read-write]Duration of the timeline in seconds (or frames for frames-based timelines) not including any repeats or repeatDelays. "totalDuration", by contrast, does include repeats and repeatDelays but since TimelineLite doesn't offer "repeat" and "repeatDelay" functionality, duration and totalDuration will always be the same. In TimelineMax, however, they could be different.
Implementation public function get duration():Number
public function set duration(value:Number):void
timeScale | property |
timeScale:Number
[read-write]Multiplier describing the speed of the timeline where 1 is normal speed, 0.5 is half-speed, 2 is double speed, etc.
Implementation public function get timeScale():Number
public function set timeScale(value:Number):void
totalDuration | property |
totalDuration:Number
[read-write]Duration of the timeline in seconds (or frames for frames-based timelines) including any repeats or repeatDelays. "duration", by contrast, does NOT include repeats and repeatDelays. Since TimelineLite doesn't offer "repeat" and "repeatDelay" functionality, duration and totalDuration will always be the same. In TimelineMax, however, they could be different.
Implementation public function get totalDuration():Number
public function set totalDuration(value:Number):void
useFrames | property |
useFrames:Boolean
[read-only]Indicates whether or not the timeline's timing mode is frames-based as opposed to time-based. This can only be set via the vars object in the constructor, or by attaching it to a timeline with the desired timing mode (a timeline's timing mode is always determined by its parent timeline)
Implementation public function get useFrames():Boolean
TimelineLite | () | constructor |
public function TimelineLite(vars:Object = null)
Constructor.
SPECIAL PROPERTIES
The following special properties may be passed in via the constructor's vars parameter, like
new TimelineLite({paused:true, onComplete:myFunction})
currentProgress
property to 1 immediately
after creating the timeline.tweens
special property
to pass in an Array of TweenLite/TweenMax/TimelineLite/TimelineMax instances. You can use this in conjunction
with the align and stagger special properties to set up complex sequences with minimal code.
These values simply get passed to the insertMultiple() method.tweens
special property when multiple tweens are
to be inserted immediately. The value simply gets passed to the
insertMultiple()
method. The default is TweenAlign.NORMAL
. Options are:
align
special property does not force all child tweens/timelines to maintain
relative positioning, so for example, if you use TweenAlign.SEQUENCE and then later change the duration
of one of the nested tweens, it does not force all subsequent timelines to change their position
on the timeline. The align
special property only affects the alignment of the tweens that are
initially placed into the timeline through the tweens
special property of the vars
object.tweens
special property when multiple tweens are
to be inserted immediately. It staggers the tweens by a set amount of time (in seconds) (or
in frames if "useFrames" is true). For example, if the stagger value is 0.5 and the "align"
property is set to TweenAlign.START, the second tween 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
TweenAlign.SEQUENCE, there would be 0.5 seconds added between each tween. This value simply gets
passed to the insertMultiple() method. Default is 0.currentProgress
won't necessarily
be zero when onStart
is called. For example, if the timeline is created and then its currentProgress
property is immediately set to 0.5 or if its currentTime
property is set to something other than zero,
onStart
will still get fired because it is the first time the timeline is getting rendered.)reverse()
or set the
currentProgress
value to a lower value, etc.). It can, however, improve speed and memory
management. TweenLite's root timelines use autoRemoveChildren:true
.vars:Object (default = null ) — optionally pass in special properties like useFrames, onComplete, onCompleteParams, onUpdate, onUpdateParams, onStart, onStartParams, tweens, align, stagger, delay, reversed, and/or autoRemoveChildren .
|
addLabel | () | method |
public function addLabel(label:String, time:Number):void
Adds a label to the timeline, making it easy to mark important positions/times. gotoAndStop() and gotoAndPlay() allow you to skip directly to any label. This works just like timeline labels in the Flash IDE.
Parameterslabel:String — The name of the label
|
|
time:Number — The time in seconds (or frames for frames-based timelines) at which the label should be added. For example, myTimeline.addLabel("myLabel", 3) adds the label "myLabel" at 3 seconds into the timeline.
|
append | () | method |
public function append(tween:TweenCore, offset:Number = 0):void
Inserts a TweenLite, TweenMax, TimelineLite, or TimelineMax instance at the end of the timeline, optionally offsetting its insertion point by a certain amount (to make it overlap with the end of the timeline or leave a gap before its insertion point). This makes it easy to build sequences by continuing to append() tweens or timelines.
Parameterstween:TweenCore — TweenLite, TweenMax, TimelineLite, or TimelineMax instance to append.
|
|
offset:Number (default = 0 ) — Amount of seconds (or frames for frames-based timelines) to offset the insertion point of the tween from the end of the timeline. For example, to append a tween 3 seconds after the end of the timeline (leaving a 3-second gap), set the offset to 3. Or to have the tween appended so that it overlaps with the last 2 seconds of the timeline, set the offset to -2. The default is 0 so that the insertion point is exactly at the end of the timeline.
|
appendMultiple | () | method |
public function appendMultiple(tweens:Array, offset:Number = 0, align:String = "normal", stagger:Number = 0):void
Appends multiple tweens/timelines at the end of the timeline at once, optionally offsetting the insertion point by a certain amount,
aligning them (as a sequence for example), and/or staggering their relative timing. This is one of the most powerful methods in
TimelineLite because it accommodates advanced timing effects and builds complex sequences with relatively little code.
tweens:Array — an Array containing any or all of the following: TweenLite, TweenMax, TimelineLite, and/or TimelineMax instances
|
|
offset:Number (default = 0 ) — Amount of seconds (or frames for frames-based timelines) to offset the insertion point of the tweens from the end of the timeline. For example, to start appending the tweens 3 seconds after the end of the timeline (leaving a 3-second gap), set the offset to 3. Or to have the tweens appended so that the insertion point overlaps with the last 2 seconds of the timeline, set the offset to -2. The default is 0 so that the insertion point is exactly at the end of the timeline.
|
|
align:String (default = "normal ") — determines how the tweens will be aligned in relation to each other before getting appended. Options are: TweenAlign.SEQUENCE (aligns the tweens one-after-the-other in a sequence), TweenAlign.START (aligns the start times of all of the tweens (ignores delays)), and TweenAlign.NORMAL (aligns the start times of all the tweens (honors delays)). The default is NORMAL.
|
|
stagger:Number (default = 0 ) — staggers the tweens 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" property is set to TweenAlign.START, the second tween 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 TweenAlign.SEQUENCE, there would be 0.5 seconds added between each tween. Default is 0.
|
clear | () | method |
public function clear(tweens:Array = null):void
Empties the timeline of all child tweens/timelines, or you can optionally pass an Array containing specific
tweens/timelines to remove. So myTimeline.clear()
would remove all children whereas
myTimeline.clear([tween1, tween2])
would only remove tween1 and tween2. You could even clear only
the tweens of a particular object with myTimeline.clear(myTimeline.getTweensOf(myObject));
tweens:Array (default = null ) — (optional) An Array containing specific children to remove.
|
getChildren | () | method |
public function getChildren(nested:Boolean = true, tweens:Boolean = true, timelines:Boolean = true, ignoreBeforeTime:Number = -9999999999):Array
Provides an easy way to get all of the tweens and/or timelines nested in this timeline (as an Array).
Parametersnested:Boolean (default = true ) — determines whether or not tweens and/or timelines that are inside nested timelines should be returned. If you only want the "top level" tweens/timelines, set this to false.
|
|
tweens:Boolean (default = true ) — determines whether or not tweens (TweenLite and TweenMax instances) should be included in the results
|
|
timelines:Boolean (default = true ) — determines whether or not timelines (TimelineLite and TimelineMax instances) should be included in the results
|
|
ignoreBeforeTime:Number (default = -9999999999 ) — All children with start times that are less than this value will be ignored.
|
Array — an Array containing the child tweens/timelines.
|
getLabelTime | () | method |
public function getLabelTime(label:String):Number
Returns the time associated with a particular label. If the label isn't found, -1 is returned.
Parameterslabel:String — Label name
|
Number — Time associated with the label (or 0 if there is no such label)
|
getTweensOf | () | method |
public function getTweensOf(target:Object, nested:Boolean = true):Array
Returns the tweens of a particular object that are inside this timeline.
Parameterstarget:Object — the target object of the tweens
|
|
nested:Boolean (default = true ) — determines whether or not tweens that are inside nested timelines should be returned. If you only want the "top level" tweens/timelines, set this to false.
|
Array — an Array of TweenLite and TweenMax instances
|
goto | () | method |
public function goto(timeOrLabel:*, suppressEvents:Boolean = true):void
Skips to a particular time, frame, or label without changing the paused state of the timeline
ParameterstimeOrLabel:* — time in seconds (or frame if the timeline is frames-based) or label to skip to. For example, myTimeline.goto(2) will skip to 2-seconds into a timeline, and myTimeline.goto("myLabel") will skip to wherever "myLabel" is.
|
|
suppressEvents:Boolean (default = true ) — If true, no events or callbacks will be triggered as the "virtual playhead" moves to the new position (onComplete, onUpdate, onReverseComplete, etc. of this timeline and any of its child tweens/timelines won't be triggered, nor will any of the associated events be dispatched)
|
gotoAndPlay | () | method |
public function gotoAndPlay(timeOrLabel:*, suppressEvents:Boolean = true):void
Skips to a particular time, frame, or label and plays the timeline forwards from there (unpausing it)
ParameterstimeOrLabel:* — time in seconds (or frame if the timeline is frames-based) or label to skip to. For example, myTimeline.gotoAndPlay(2) will skip to 2-seconds into a timeline, and myTimeline.gotoAndPlay("myLabel") will skip to wherever "myLabel" is.
|
|
suppressEvents:Boolean (default = true ) — If true, no events or callbacks will be triggered as the "virtual playhead" moves to the new position (onComplete, onUpdate, onReverseComplete, etc. of this timeline and any of its child tweens/timelines won't be triggered, nor will any of the associated events be dispatched)
|
gotoAndStop | () | method |
public function gotoAndStop(timeOrLabel:*, suppressEvents:Boolean = true):void
Skips to a particular time, frame, or label and stops the timeline (pausing it)
ParameterstimeOrLabel:* — time in seconds (or frame if the timeline is frames-based) or label to skip to. For example, myTimeline.gotoAndStop(2) will skip to 2-seconds into a timeline, and myTimeline.gotoAndStop("myLabel") will skip to wherever "myLabel" is.
|
|
suppressEvents:Boolean (default = true ) — If true, no events or callbacks will be triggered as the "virtual playhead" moves to the new position (onComplete, onUpdate, onReverseComplete, etc. of this timeline and any of its child tweens/timelines won't be triggered, nor will any of the associated events be dispatched)
|
insert | () | method |
public function insert(tween:TweenCore, timeOrLabel:* = 0):void
Inserts a TweenLite, TweenMax, TimelineLite, or TimelineMax instance into the timeline at a specific time, frame, or label. If you insert at a label that doesn't exist yet, one is created at the end of the timeline.
Parameterstween:TweenCore — TweenLite, TweenMax, TimelineLite, or TimelineMax instance to insert
|
|
timeOrLabel:* (default = 0 ) — The time in seconds (or frames for frames-based timelines) or label at which the tween/timeline should be inserted. For example, myTimeline.insert(myTween, 3) would insert myTween 3-seconds into the timeline, and myTimeline.insert(myTween, "myLabel") would insert it at the "myLabel" label.
|
insertMultiple | () | method |
public function insertMultiple(tweens:Array, timeOrLabel:String = "0", align:Number = normal, stagger:* = 0):void
Inserts multiple tweens/timelines into the timeline at once, optionally aligning them (as a sequence for example)
and/or staggering the timing. This is one of the most powerful methods in TimelineLite because it accommodates
advanced timing effects and builds complex sequences with relatively little code.
tweens:Array — an Array containing any or all of the following: TweenLite, TweenMax, TimelineLite, and/or TimelineMax instances
|
|
timeOrLabel:String (default = "0 ") — time in seconds (or frame if the timeline is frames-based) or label that serves as the point of insertion. For example, the number 2 would insert the tweens beginning at 2-seconds into the timeline, or "myLabel" would ihsert them wherever "myLabel" is.
|
|
align:Number (default = normal ) — determines how the tweens will be aligned in relation to each other before getting inserted. Options are: TweenAlign.SEQUENCE (aligns the tweens one-after-the-other in a sequence), TweenAlign.START (aligns the start times of all of the tweens (ignores delays)), and TweenAlign.NORMAL (aligns the start times of all the tweens (honors delays)). The default is NORMAL.
|
|
stagger:* (default = 0 ) — staggers the tweens 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" property is set to TweenAlign.START, the second tween 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 TweenAlign.SEQUENCE, there would be 0.5 seconds added between each tween. Default is 0.
|
invalidate | () | method |
public override function invalidate():void
Clears any initialization data (like starting values in tweens) which can be useful if, for example,
you want to restart it without reverting to any previously recorded starting values. When you invalidate()
a tween/timeline, it will be re-initialized the next time it renders and its vars
object will be re-parsed.
The timing of the tween/timeline (duration, startTime, delay) will NOT be affected. Another example would be if you
have a TweenMax(mc, 1, {x:100, y:100})
that ran when mc.x and mc.y were initially at 0, but now mc.x
and mc.y are 200 and you want them tween to 100 again, you could simply invalidate()
the tween and
restart()
it. Without invalidating first, restarting it would cause the values jump back to 0 immediately
(where they started when the tween originally began). When you invalidate a timeline, it automatically invalidates
all of its children.
killTweensOf | () | method |
public function killTweensOf(target:Object, nested:Boolean = true):Boolean
Kills tweens of a particular object.
Parameterstarget:Object — the target object of the tweens
|
|
nested:Boolean (default = true ) — determines whether or not tweens that are inside nested timelines should be affected. If you only want the "top level" tweens/timelines to be affected, set this to false.
|
Boolean |
prepend | () | method |
public function prepend(tween:TweenCore, adjustLabels:Boolean = false):void
Inserts a TweenLite, TweenMax, TimelineLite, or TimelineMax instance at the beginning of the timeline, pushing all existing tweens back in time to make room for the newly inserted one. You can optionally affect the positions of labels too.
Parameterstween:TweenCore — TweenLite, TweenMax, TimelineLite, or TimelineMax instance to prepend
|
|
adjustLabels:Boolean (default = false ) — If true, all existing labels will be adjusted back in time along with the existing tweens to keep them aligned. (default is false)
|
prependMultiple | () | method |
public function prependMultiple(tweens:Array, align:String = "normal", stagger:Number = 0, adjustLabels:Boolean = false):void
Prepends multiple tweens/timelines to the beginning of the timeline at once, moving all existing children back to make
room, and optionally aligning the new children (as a sequence for example) and/or staggering the timing.
tweens:Array — an Array containing any or all of the following: TweenLite, TweenMax, TimelineLite, and/or TimelineMax instances
|
|
align:String (default = "normal ") — determines how the tweens will be aligned in relation to each other before getting prepended. Options are: TweenAlign.SEQUENCE (aligns the tweens one-after-the-other in a sequence), TweenAlign.START (aligns the start times of all of the tweens (ignores delays)), and TweenAlign.NORMAL (aligns the start times of all the tweens (honors delays)). The default is NORMAL.
|
|
stagger:Number (default = 0 ) — staggers the tweens 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" property is set to TweenAlign.START, the second tween 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 TweenAlign.SEQUENCE, there would be 0.5 seconds added between each tween. Default is 0.
|
|
adjustLabels:Boolean (default = false )
|
remove | () | method |
public override function remove(tween:TweenCore, skipDisable:Boolean = false):void
Removes a TweenLite, TweenMax, TimelineLite, or TimelineMax instance from the timeline.
Parameterstween:TweenCore — TweenLite, TweenMax, TimelineLite, or TimelineMax instance to remove
|
|
skipDisable:Boolean (default = false ) — If false (the default), the TweenLite/Max/TimelineLite/Max instance is disabled. This is primarily used internally - there's really no reason to set it to true.
|
shiftChildren | () | method |
public function shiftChildren(amount:Number, adjustLabels:Boolean = false, ignoreBeforeTime:Number = 0):void
Shifts the startTime of the timeline's children by a certain amount and optionally adjusts labels too. This can be useful when you want to prepend children or splice them into a certain spot, moving existing ones back to make room for the new ones.
Parametersamount:Number — Number of seconds (or frames for frames-based timelines) to move each child.
|
|
adjustLabels:Boolean (default = false ) — If true, the timing of all labels will be adjusted as well.
|
|
ignoreBeforeTime:Number (default = 0 ) — All children that begin at or after the startAtTime will be affected by the shift (the default is 0, causing all children to be affected). This provides an easy way to splice children into a certain spot on the timeline, pushing only the children after that point back to make room.
|
stop | () | method |
public function stop():void
Pauses the timeline (same as pause() - added stop() for consistency with Flash's MovieClip.stop() functionality)