/src/uncompressed/TweenMax.js
JavaScript | 4682 lines | 3987 code | 496 blank | 199 comment | 1549 complexity | 3eb5d8aab3b6e0270f99ba8d514be45d MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- /**
- * VERSION: beta 1.542
- * DATE: 2012-10-01
- * JavaScript (ActionScript 3 and 2 also available)
- * UPDATES AND DOCS AT: http://www.greensock.com
- *
- * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, easing.EasePack, plugins.CSSPlugin, plugins.RoundPropsPlugin, plugins.BezierPlugin
- *
- * Copyright (c) 2008-2012, 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 your membership.
- *
- * @author: Jack Doyle, jack@greensock.com
- **/
- (window._gsQueue || (window._gsQueue = [])).push( function() {
- /*
- * ----------------------------------------------------------------
- * TweenMax
- * ----------------------------------------------------------------
- */
- _gsDefine("TweenMax", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) {
-
- var TweenMax = function(target, duration, vars) {
- TweenLite.call(this, target, duration, vars);
- this._cycle = 0;
- this._yoyo = (this.vars.yoyo == true);
- this._repeat = this.vars.repeat || 0;
- this._repeatDelay = this.vars.repeatDelay || 0;
- this._dirty = true; //ensures that if there is any repeat, the totalDuration will get recalculated to accurately report it.
- },
- p = TweenMax.prototype = TweenLite.to({}, 0.1, {}),
- _blankArray = [];
-
- p.constructor = TweenMax;
- p.kill()._gc = false;
- TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf;
- TweenMax.getTweensOf = TweenLite.getTweensOf;
- TweenMax.ticker = TweenLite.ticker;
-
- p.invalidate = function() {
- this._yoyo = (this.vars.yoyo == true);
- this._repeat = this.vars.repeat || 0;
- this._repeatDelay = this.vars.repeatDelay || 0;
- this._uncache(true);
- return TweenLite.prototype.invalidate.call(this);
- };
-
- p.updateTo = function(vars, resetDuration) {
- var curRatio = this.ratio, p;
- if (resetDuration) if (this.timeline != null) if (this._startTime < this._timeline._time) {
- this._startTime = this._timeline._time;
- this._uncache(false);
- if (this._gc) {
- this._enabled(true, false);
- } else {
- this._timeline.insert(this, this._startTime - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct.
- }
- }
- for (p in vars) {
- this.vars[p] = vars[p];
- }
- if (this._initted) {
- if (resetDuration) {
- this._initted = false;
- } else {
- if (this._notifyPluginsOfEnabled && this._firstPT) {
- TweenLite._onPluginEvent("_onDisable", this); //in case a plugin like MotionBlur must perform some cleanup tasks
- }
- if (this._time / this._duration > 0.998) { //if the tween has finished (or come extremely close to finishing), we just need to rewind it to 0 and then render it again at the end which forces it to re-initialize (parsing the new vars). We allow tweens that are close to finishing (but haven't quite finished) to work this way too because otherwise, the values are so small when determining where to project the starting values that binary math issues creep in and can make the tween appear to render incorrectly when run backwards.
- var prevTime = this._time;
- this.render(0, true, false);
- this._initted = false;
- this.render(prevTime, true, false);
- } else if (this._time > 0) {
- this._initted = false;
- this._init();
- var inv = 1 / (1 - curRatio),
- pt = this._firstPT, endValue;
- while (pt) {
- endValue = pt.s + pt.c;
- pt.c *= inv;
- pt.s = endValue - pt.c;
- pt = pt._next;
- }
- }
- }
- }
- return this;
- };
-
- p.render = function(time, suppressEvents, force) {
- var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(),
- prevTime = this._time,
- prevTotalTime = this._totalTime,
- prevCycle = this._cycle,
- isComplete, callback, pt;
- if (time >= totalDur) {
- this._totalTime = totalDur;
- this._cycle = this._repeat;
- if (this._yoyo && (this._cycle & 1) !== 0) {
- this._time = 0;
- this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0;
- } else {
- this._time = this._duration;
- this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1;
- }
- if (!this._reversed) {
- isComplete = true;
- callback = "onComplete";
- }
- if (this._duration === 0) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
- if (time === 0 || this._rawPrevTime < 0) if (this._rawPrevTime !== time) {
- force = true;
- }
- this._rawPrevTime = time;
- }
-
- } else if (time <= 0) {
- this._totalTime = this._time = this._cycle = 0;
- this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0;
- if (prevTotalTime !== 0 || (this._duration === 0 && this._rawPrevTime > 0)) {
- callback = "onReverseComplete";
- isComplete = this._reversed;
- }
- if (time < 0) {
- this._active = false;
- if (this._duration === 0) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
- if (this._rawPrevTime >= 0) {
- force = true;
- }
- this._rawPrevTime = time;
- }
- } else if (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.
- force = true;
- }
- } else {
- this._totalTime = this._time = time;
-
- if (this._repeat !== 0) {
- var cycleDuration = this._duration + this._repeatDelay;
- this._cycle = (this._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but Flash reports it as 0.79999999!)
- if (this._cycle !== 0) if (this._cycle === this._totalTime / cycleDuration) {
- this._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning)
- }
- this._time = this._totalTime - (this._cycle * cycleDuration);
- if (this._yoyo) if ((this._cycle & 1) !== 0) {
- this._time = this._duration - this._time;
- }
- if (this._time > this._duration) {
- this._time = this._duration;
- } else if (this._time < 0) {
- this._time = 0;
- }
- }
-
- if (this._easeType) {
- var r = this._time / this._duration,
- type = this._easeType,
- pow = this._easePower;
- if (type === 1 || (type === 3 && r >= 0.5)) {
- r = 1 - r;
- }
- if (type === 3) {
- r *= 2;
- }
- if (pow === 1) {
- r *= r;
- } else if (pow === 2) {
- r *= r * r;
- } else if (pow === 3) {
- r *= r * r * r;
- } else if (pow === 4) {
- r *= r * r * r * r;
- }
-
- if (type === 1) {
- this.ratio = 1 - r;
- } else if (type === 2) {
- this.ratio = r;
- } else if (this._time / this._duration < 0.5) {
- this.ratio = r / 2;
- } else {
- this.ratio = 1 - (r / 2);
- }
-
- } else {
- this.ratio = this._ease.getRatio(this._time / this._duration);
- }
-
- }
-
- if (prevTime === this._time && !force) {
- return;
- } else if (!this._initted) {
- this._init();
- if (!isComplete && this._time) { //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently.
- this.ratio = this._ease.getRatio(this._time / this._duration);
- }
- }
-
-
-
- if (!this._active) if (!this._paused) {
- this._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done.
- }
- if (prevTotalTime == 0) if (this.vars.onStart) if (this._totalTime !== 0 || this._duration === 0) if (!suppressEvents) {
- this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray);
- }
-
- pt = this._firstPT;
- while (pt) {
- if (pt.f) {
- pt.t[pt.p](pt.c * this.ratio + pt.s);
- } else {
- pt.t[pt.p] = pt.c * this.ratio + pt.s;
- }
- pt = pt._next;
- }
-
- if (this._onUpdate) if (!suppressEvents) {
- this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
- }
- if (this._cycle != prevCycle) if (!suppressEvents) if (!this._gc) if (this.vars.onRepeat) {
- this.vars.onRepeat.apply(this.vars.onRepeatScope || this, this.vars.onRepeatParams || _blankArray);
- }
- if (callback) if (!this._gc) { //check gc because there's a chance that kill() could be called in an onUpdate
- if (isComplete) {
- if (this._timeline.autoRemoveChildren) {
- this._enabled(false, false);
- }
- this._active = false;
- }
- if (!suppressEvents) if (this.vars[callback]) {
- this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray);
- }
- }
- };
-
- //---- STATIC FUNCTIONS -----------------------------------------------------------------------------------------------------------
-
- TweenMax.to = function(target, duration, vars) {
- return new TweenMax(target, duration, vars);
- };
-
- TweenMax.from = function(target, duration, vars) {
- vars.runBackwards = true;
- if (vars.immediateRender != false) {
- vars.immediateRender = true;
- }
- return new TweenMax(target, duration, vars);
- };
-
- TweenMax.fromTo = function(target, duration, fromVars, toVars) {
- toVars.startAt = fromVars;
- if (fromVars.immediateRender) {
- toVars.immediateRender = true;
- }
- return new TweenMax(target, duration, toVars);
- };
-
- TweenMax.staggerTo = TweenMax.allTo = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
- stagger = stagger || 0;
- var a = [],
- l = targets.length,
- delay = vars.delay || 0,
- copy, i, p;
- for (i = 0; i < l; i++) {
- copy = {};
- for (p in vars) {
- copy[p] = vars[p];
- }
- copy.delay = delay;
- if (i === l - 1) if (onCompleteAll) {
- copy.onComplete = function() {
- if (vars.onComplete) {
- vars.onComplete.apply(vars.onCompleteScope, vars.onCompleteParams);
- }
- onCompleteAll.apply(onCompleteAllScope, onCompleteAllParams);
- }
- }
- a[i] = new TweenMax(targets[i], duration, copy);
- delay += stagger;
- }
- return a;
- };
-
- TweenMax.staggerFrom = TweenMax.allFrom = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
- vars.runBackwards = true;
- if (vars.immediateRender != false) {
- vars.immediateRender = true;
- }
- return TweenMax.staggerTo(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
- };
-
- TweenMax.staggerFromTo = TweenMax.allFromTo = function(targets, duration, fromVars, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
- toVars.startAt = fromVars;
- if (fromVars.immediateRender) {
- toVars.immediateRender = true;
- }
- return TweenMax.staggerTo(targets, duration, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
- };
-
- TweenMax.delayedCall = function(delay, callback, params, scope, useFrames) {
- return new TweenMax(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, onCompleteScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, onReverseCompleteScope:scope, immediateRender:false, useFrames:useFrames, overwrite:0});
- };
-
- TweenMax.set = function(target, vars) {
- return new TweenMax(target, 0, vars);
- };
-
- TweenMax.isTweening = function(target) {
- var a = TweenLite.getTweensOf(target),
- i = a.length,
- tween;
- while (--i > -1) {
- if (((tween = a[i])._active || (tween._startTime === tween.timeline._time && tween.timeline._active))) {
- return true;
- }
- }
- return false;
- };
-
- var _getChildrenOf = function(timeline, includeTimelines) {
- var a = [],
- cnt = 0,
- tween = timeline._first;
- while (tween) {
- if (tween instanceof TweenLite) {
- a[cnt++] = tween;
- } else {
- if (includeTimelines) {
- a[cnt++] = tween;
- }
- a = a.concat(_getChildrenOf(tween, includeTimelines));
- cnt = a.length;
- }
- tween = tween._next;
- }
- return a;
- },
- getAllTweens = TweenMax.getAllTweens = function(includeTimelines) {
- var a = _getChildrenOf(Animation._rootTimeline, includeTimelines);
- return a.concat( _getChildrenOf(Animation._rootFramesTimeline, includeTimelines) );
- };
-
- TweenMax.killAll = function(complete, tweens, delayedCalls, timelines) {
- if (tweens == null) {
- tweens = true;
- }
- if (delayedCalls == null) {
- delayedCalls = true;
- }
- var a = getAllTweens((timelines != false)),
- l = a.length,
- allTrue = (tweens && delayedCalls && timelines),
- isDC, tween, i;
- for (i = 0; i < l; i++) {
- tween = a[i];
- if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) {
- if (complete) {
- tween.totalTime(tween.totalDuration());
- } else {
- tween._enabled(false, false);
- }
- }
- }
- };
-
- TweenMax.killChildTweensOf = function(parent, complete) {
- if (parent == null) {
- return;
- }
- if (parent.jquery) {
- parent.each( function(i, e) {
- TweenMax.killChildTweensOf(e, complete);
- });
- return;
- }
- var tl = TweenLite._tweenLookup,
- a = [],
- target, curParent, p, i, l;
- for (p in tl) {
- curParent = tl[p].target.parentNode;
- while (curParent) {
- if (curParent === parent) {
- a = a.concat(tl[p].tweens);
- }
- curParent = curParent.parentNode;
- }
- }
- l = a.length;
- for (i = 0; i < l; i++) {
- if (complete) {
- a[i].totalTime(a[i].totalDuration());
- }
- a[i]._enabled(false, false);
- }
- };
-
- TweenMax.pauseAll = function(tweens, delayedCalls, timelines) {
- _changePause(true, tweens, delayedCalls, timelines);
- };
-
- TweenMax.resumeAll = function(tweens, delayedCalls, timelines) {
- _changePause(false, tweens, delayedCalls, timelines);
- };
-
- var _changePause = function(pause, tweens, delayedCalls, timelines) {
- if (tweens == undefined) {
- tweens = true;
- }
- if (delayedCalls == undefined) {
- delayedCalls = true;
- }
- var a = getAllTweens(timelines),
- allTrue = (tweens && delayedCalls && timelines),
- i = a.length,
- isDC, tween;
- while (--i > -1) {
- tween = a[i];
- if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) {
- tween.paused(pause);
- }
- }
- };
-
-
- //---- GETTERS / SETTERS ----------------------------------------------------------------------------------------------------------
-
- p.progress = function(value) {
- return (!arguments.length) ? this._time / this.duration() : this.totalTime( this.duration() * value + (this._cycle * this._duration), false);
- };
-
- p.totalProgress = function(value) {
- return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, false);
- };
-
- p.time = function(value, suppressEvents) {
- if (!arguments.length) {
- return this._time;
- }
- if (this._dirty) {
- this.totalDuration();
- }
- if (value > this._duration) {
- value = this._duration;
- }
- if (this._yoyo && (this._cycle & 1) !== 0) {
- value = (this._duration - value) + (this._cycle * (this._duration + this._repeatDelay));
- } else if (this._repeat != 0) {
- value += this._cycle * (this._duration + this._repeatDelay);
- }
- return this.totalTime(value, suppressEvents);
- };
-
- p.totalDuration = function(value) {
- if (!arguments.length) {
- if (this._dirty) {
- //instead of Infinity, we use 999999999999 so that we can accommodate reverses
- this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat);
- this._dirty = false;
- }
- return this._totalDuration;
- }
- return (this._repeat == -1) ? this : this.duration( (value - (this._repeat * this._repeatDelay)) / (this._repeat + 1) );
- };
-
- p.repeat = function(value) {
- if (!arguments.length) {
- return this._repeat;
- }
- this._repeat = value;
- return this._uncache(true);
- };
-
- p.repeatDelay = function(value) {
- if (!arguments.length) {
- return this._repeatDelay;
- }
- this._repeatDelay = value;
- return this._uncache(true);
- };
-
- p.yoyo = function(value) {
- if (!arguments.length) {
- return this._yoyo;
- }
- this._yoyo = value;
- return this;
- };
-
-
- return TweenMax;
-
- }, true);
- /*
- * ----------------------------------------------------------------
- * TimelineLite (!TimelineLite)
- * ----------------------------------------------------------------
- */
- _gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) {
-
- "use strict";
-
- var TimelineLite = function(vars) {
- SimpleTimeline.call(this, vars);
- this._labels = {};
- this.autoRemoveChildren = (this.vars.autoRemoveChildren == true);
- this.smoothChildTiming = (this.vars.smoothChildTiming == true);
- this._sortChildren = true;
- this._onUpdate = this.vars.onUpdate;
- var i = _paramProps.length,
- j, a;
- while (--i > -1) {
- if ((a = this.vars[_paramProps[i]])) {
- j = a.length;
- while (--j > -1) {
- if (a[j] === "{self}") {
- a = this.vars[_paramProps[i]] = a.concat(); //copy the array in case the user referenced the same array in multiple timelines/tweens (each {self} should be unique)
- a[j] = this;
- }
- }
- }
- }
- if (this.vars.tweens instanceof Array) {
- this.insertMultiple(this.vars.tweens, 0, this.vars.align || "normal", this.vars.stagger || 0);
- }
- },
- _paramProps = ["onStartParams","onUpdateParams","onCompleteParams","onReverseCompleteParams","onRepeatParams"],
- _blankArray = [],
- _copy = function(vars) {
- var copy = {}, p;
- for (p in vars) {
- copy[p] = vars[p];
- }
- return copy;
- },
- p = TimelineLite.prototype = new SimpleTimeline();
-
- p.constructor = TimelineLite;
- p.kill()._gc = false;
-
- p.to = function(target, duration, vars, offset, baseTimeOrLabel) {
- return this.insert( new TweenLite(target, duration, vars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0));
- }
-
- p.from = function(target, duration, vars, offset, baseTimeOrLabel) {
- return this.insert( TweenLite.from(target, duration, vars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0));
- }
-
- p.fromTo = function(target, duration, fromVars, toVars, offset, baseTimeOrLabel) {
- return this.insert( TweenLite.fromTo(target, duration, fromVars, toVars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0));
- }
-
- p.staggerTo = function(targets, duration, vars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
- var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, onCompleteScope:onCompleteAllScope});
- stagger = stagger || 0;
- for (var i = 0; i < targets.length; i++) {
- if (vars.startAt != null) {
- vars.startAt = _copy(vars.startAt);
- }
- tl.insert( new TweenLite(targets[i], duration, _copy(vars)), i * stagger);
- }
- return this.insert(tl, this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0));
- }
-
- p.staggerFrom = function(targets, duration, vars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
- if (vars.immediateRender == null) {
- vars.immediateRender = true;
- }
- vars.runBackwards = true;
- return this.staggerTo(targets, duration, vars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
- }
-
- p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
- toVars.startAt = fromVars;
- if (fromVars.immediateRender) {
- toVars.immediateRender = true;
- }
- return this.staggerTo(targets, duration, toVars, stagger, offset, baseTimeOrLabel, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
- }
-
- p.call = function(callback, params, scope, offset, baseTimeOrLabel) {
- return this.insert( TweenLite.delayedCall(0, callback, params, scope), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0));
- }
-
- p.set = function(target, vars, offset, baseTimeOrLabel) {
- vars.immediateRender = false;
- return this.insert( new TweenLite(target, 0, vars), this._parseTimeOrLabel(baseTimeOrLabel) + (offset || 0));
- }
-
- TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) {
- vars = vars || {};
- if (vars.smoothChildTiming == null) {
- vars.smoothChildTiming = true;
- }
- var tl = new TimelineLite(vars),
- root = tl._timeline;
- if (ignoreDelayedCalls == null) {
- ignoreDelayedCalls = true;
- }
- root._remove(tl, true);
- tl._startTime = 0;
- tl._rawPrevTime = tl._time = tl._totalTime = root._time;
- var tween = root._first, next;
- while (tween) {
- next = tween._next;
- if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target == tween.vars.onComplete)) {
- tl.insert(tween, tween._startTime - tween._delay);
- }
- tween = next;
- }
- root.insert(tl, 0);
- return tl;
- }
-
- p.insert = function(value, timeOrLabel) {
- if (value instanceof Animation) {
- //continue...
- } else if (value instanceof Array) {
- return this.insertMultiple(value, timeOrLabel);
- } else if (typeof(value) === "string") {
- return this.addLabel(value, this._parseTimeOrLabel(timeOrLabel || 0, true));
- } else if (typeof(value) === "function") {
- value = TweenLite.delayedCall(0, value);
- } else {
- throw ("ERROR: Cannot insert() " + value + " into the TimelineLite/Max because it is neither a tween, timeline, function, nor a String.");
- return this;
- }
-
- SimpleTimeline.prototype.insert.call(this, value, this._parseTimeOrLabel(timeOrLabel || 0, true));
-
- //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly.
- if (this._gc) if (!this._paused) if (this._time === this._duration) if (this._time < this.duration()) {
- //in case any of the anscestors had completed but should now be enabled...
- var tl = this;
- while (tl._gc && tl._timeline) {
- if (tl._timeline.smoothChildTiming) {
- tl.totalTime(tl._totalTime, true); //also enables them
- } else {
- tl._enabled(true, false);
- }
- tl = tl._timeline;
- }
- }
- return this;
- }
-
- p.remove = function(value) {
- if (value instanceof Animation) {
- return this._remove(value, false);
- } else if (value instanceof Array) {
- var i = value.length;
- while (--i > -1) {
- this.remove(value[i]);
- }
- return this;
- } else if (typeof(value) === "string") {
- return this.removeLabel(value);
- }
- return this.kill(null, value);
- }
-
- p.append = function(value, offset) {
- return this.insert(value, this.duration() + (offset || 0));
- }
-
- p.insertMultiple = function(tweens, timeOrLabel, align, stagger) {
- align = align || "normal";
- stagger = stagger || 0;
- var i, tween, curTime = this._parseTimeOrLabel(timeOrLabel || 0, true), l = tweens.length;
- for (i = 0; i < l; i++) {
- if ((tween = tweens[i]) instanceof Array) {
- tween = new TimelineLite({tweens:tween});
- }
- this.insert(tween, curTime);
- if (typeof(tween) === "string" || typeof(tween) === "function") {
- //do nothing
- } else if (align === "sequence") {
- curTime = tween._startTime + (tween.totalDuration() / tween._timeScale);
- } else if (align === "start") {
- tween._startTime -= tween.delay();
- }
- curTime += stagger;
- }
- return this._uncache(true);
- }
-
- p.appendMultiple = function(tweens, offset, align, stagger) {
- return this.insertMultiple(tweens, this.duration() + (offset || 0), align, stagger);
- }
-
- p.addLabel = function(label, time) {
- this._labels[label] = time;
- return this;
- }
-
- p.removeLabel = function(label) {
- delete this._labels[label];
- return this;
- }
-
- p.getLabelTime = function(label) {
- return (this._labels[label] != null) ? this._labels[label] : -1;
- }
-
- p._parseTimeOrLabel = function(timeOrLabel, appendIfAbsent) {
- if (timeOrLabel == null) {
- return this.duration();
- } else if (typeof(timeOrLabel) === "string" && isNaN(timeOrLabel)) {
- if (this._labels[timeOrLabel] == null) {
- return (appendIfAbsent) ? (this._labels[timeOrLabel] = this.duration()) : 0;
- }
- return this._labels[timeOrLabel];
- }
- return Number(timeOrLabel);
- }
-
- p.seek = function(timeOrLabel, suppressEvents) {
- return this.totalTime(this._parseTimeOrLabel(timeOrLabel, false), (suppressEvents != false));
- }
-
- p.stop = function() {
- return this.paused(true);
- }
-
- p.gotoAndPlay = function(timeOrLabel, suppressEvents) {
- return SimpleTimeline.prototype.play.call(this, timeOrLabel, suppressEvents);
- }
-
- p.gotoAndStop = function(timeOrLabel, suppressEvents) {
- return this.pause(timeOrLabel, suppressEvents);
- }
-
- p.render = function(time, suppressEvents, force) {
- if (this._gc) {
- this._enabled(true, false);
- }
- this._active = !this._paused;
- var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(),
- prevTime = this._time,
- prevStart = this._startTime,
- prevTimeScale = this._timeScale,
- prevPaused = this._paused,
- tween, isComplete, next, callback;
- if (time >= totalDur) {
- this._totalTime = this._time = totalDur;
- if (!this._reversed) if (!this._hasPausedChild()) {
- isComplete = true;
- callback = "onComplete";
- if (this._duration === 0) if (time === 0 || this._rawPrevTime < 0) if (this._rawPrevTime !== time) { //In order to accommodate zero-duration timelines, we must discern the momentum/direction of time in order to render values properly when the "playhead" goes past 0 in the forward direction or lands directly on it, and also when it moves past it in the backward direction (from a postitive time to a negative time).
- force = true;
- }
- }
- this._rawPrevTime = time;
- time = totalDur + 0.000001; //to avoid occassional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off)
- } else if (time <= 0) {
- this._totalTime = this._time = 0;
- if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime > 0)) {
- callback = "onReverseComplete";
- isComplete = this._reversed;
- }
- if (time < 0) {
- this._active = false;
- if (this._duration === 0) if (this._rawPrevTime >= 0) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
- force = true;
- }
- } else if (!this._initted) {
- force = true;
- }
- this._rawPrevTime = time;
- time = -0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being rendered at the very beginning (their progress might be 0.000000000001 instead of 0 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off)
-
- } else {
- this._totalTime = this._time = this._rawPrevTime = time;
- }
-
- if (this._time === prevTime && !force) {
- return;
- } else if (!this._initted) {
- this._initted = true;
- }
- if (prevTime === 0) if (this.vars.onStart) if (this._time !== 0) if (!suppressEvents) {
- this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray);
- }
-
- if (this._time > prevTime) {
- tween = this._first;
- while (tween) {
- next = tween._next; //record it here because the value could change after rendering...
- if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
- break;
- } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) {
-
- if (!tween._reversed) {
- tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false);
- } else {
- tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false);
- }
-
- }
- tween = next;
- }
- } else {
- tween = this._last;
- while (tween) {
- next = tween._prev; //record it here because the value could change after rendering...
- if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
- break;
- } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) {
-
- if (!tween._reversed) {
- tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false);
- } else {
- tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false);
- }
-
- }
- tween = next;
- }
- }
-
- if (this._onUpdate) if (!suppressEvents) {
- this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
- }
-
- if (callback) if (!this._gc) if (prevStart === this._startTime || prevTimeScale != this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate
- if (isComplete) {
- if (this._timeline.autoRemoveChildren) {
- this._enabled(false, false);
- }
- this._active = false;
- }
- if (!suppressEvents) if (this.vars[callback]) {
- this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray);
- }
- }
-
- }
-
- p._hasPausedChild = function() {
- var tween = this._first;
- while (tween) {
- if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) {
- return true;
- }
- tween = tween._next;
- }
- return false;
- }
-
- p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) {
- ignoreBeforeTime = ignoreBeforeTime || -9999999999;
- var a = [],
- tween = this._first,
- cnt = 0;
- while (tween) {
- if (tween._startTime < ignoreBeforeTime) {
- //do nothing
- } else if (tween instanceof TweenLite) {
- if (tweens != false) {
- a[cnt++] = tween;
- }
- } else {
- if (timelines != false) {
- a[cnt++] = tween;
- }
- if (nested != false) {
- a = a.concat(tween.getChildren(true, tweens, timelines));
- cnt = a.length;
- }
- }
- tween = tween._next;
- }
- return a;
- }
-
- p.getTweensOf = function(target, nested) {
- var tweens = TweenLite.getTweensOf(target),
- i = tweens.length,
- a = [],
- cnt = 0;
- while (--i > -1) {
- if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) {
- a[cnt++] = tweens[i];
- }
- }
- return a;
- }
-
- p._contains = function(tween) {
- var tl = tween.timeline;
- while (tl) {
- if (tl === this) {
- return true;
- }
- tl = tl.timeline;
- }
- return false;
- }
-
- p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) {
- ignoreBeforeTime = ignoreBeforeTime || 0;
- var tween = this._first;
- while (tween) {
- if (tween._startTime >= ignoreBeforeTime) {
- tween._startTime += amount;
- }
- tween = tween._next;
- }
- if (adjustLabels) {
- for (var p in this._labels) {
- if (this._labels[p] >= ignoreBeforeTime) {
- this._labels[p] += amount;
- }
- }
- }
- return this._uncache(true);
- }
-
- p._kill = function(vars, target) {
- if (vars == null) if (target == null) {
- return this._enabled(false, false);
- }
- var tweens = (target == null) ? this.getChildren(true, true, false) : this.getTweensOf(target),
- i = tweens.length,
- changed = false;
- while (--i > -1) {
- if (tweens[i]._kill(vars, target)) {
- changed = true;
- }
- }
- return changed;
- }
-
- p.clear = function(labels) {
- var tweens = this.getChildren(false, true, true),
- i = tweens.length;
- this._time = this._totalTime = 0;
- while (--i > -1) {
- tweens[i]._enabled(false, false);
- }
- if (labels != false) {
- this._labels = {};
- }
- return this._uncache(true);
- }
-
- p.invalidate = function() {
- var tween = this._first;
- while (tween) {
- tween.invalidate();
- tween = tween._next;
- }
- return this;
- }
-
- p._enabled = function(enabled, ignoreTimeline) {
- if (enabled == this._gc) {
- var tween = this._first;
- while (tween) {
- tween._enabled(enabled, true);
- tween = tween._next;
- }
- }
- return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline);
- }
-
- p.progress = function(value) {
- return (!arguments.length) ? this._time / this.duration() : this.totalTime(this.duration() * value, false);
- }
-
- p.duration = function(value) {
- if (!arguments.length) {
- if (this._dirty) {
- this.totalDuration(); //just triggers recalculation
- }
- return this._duration;
- }
- if (this.duration() !== 0) if (value !== 0) {
- this.timeScale(this._duration / value);
- }
- return this;
- }
-
- p.totalDuration = function(value) {
- if (!arguments.length) {
- if (this._dirty) {
- var max = 0,
- tween = this._first,
- prevStart = -999999999999,
- next, end;
- while (tween) {
- next = tween._next; //record it here in case the tween changes position in the sequence...
-
- if (tween._startTime < prevStart && this._sortChildren) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence
- this.insert(tween, tween._startTime - tween._delay);
- } else {
- prevStart = tween._startTime;
- }
- if (tween._startTime < 0) {//children aren't allowed to have negative startTimes, so adjust here if one is found.
- max -= tween._startTime;
- this.shiftChildren(-tween._startTime, false, -9999999999);
- }
- end = tween._startTime + ((!tween._dirty ? tween._totalDuration : tween.totalDuration()) / tween._timeScale);
- if (end > max) {
- max = end;
- }
-
- tween = next;
- }
- this._duration = this._totalDuration = max;
- this._dirty = false;
- }
- return this._totalDuration;
- }
- if (this.totalDuration() !== 0) if (value !== 0) {
- this.timeScale(this._totalDuration / value);
- }
- return this;
- }
-
- p.usesFrames = function() {
- var tl = this._timeline;
- while (tl._timeline) {
- tl = tl._timeline;
- }
- return (tl === Animation._rootFramesTimeline);
- }
-
- p.rawTime = function() {
- return (this._paused || (this._totalTime !== 0 && this._totalTime !== this._totalDuration)) ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale;
- }
-
- return TimelineLite;
-
- }, true);
-
-
-
-
-
-
- /*
- * ----------------------------------------------------------------
- * TimelineMax
- * ----------------------------------------------------------------
- */
- _gsDefine("TimelineMax", ["TimelineLite","TweenLite","easing.Ease"], function(TimelineLite, TweenLite, Ease) {
-
- var TimelineMax = function(vars) {
- TimelineLite.call(this, vars);
- this._repeat = this.vars.repeat || 0;
- this._repeatDelay = this.vars.repeatDelay || 0;
- this._cycle = 0;
- this._yoyo = (this.vars.yoyo == true);
- this._dirty = true;
- },
- _blankArray = [],
- _easeNone = new Ease(null, null, 1, 0),
- _getGlobalPaused = function(tween) {
- while (tween) {
- if (tween._paused) {
- return true;
- }
- tween = tween._timeline;
- }
- return false;
- },
- p = TimelineMax.prototype = new TimelineLite();
-
- p.constructor = TimelineMax;
- p.kill()._gc = false;
- TimelineMax.version = 12.0;
-
- p.invalidate = function() {
- this._yoyo = (this.vars.yoyo == true);
- this._repeat = this.vars.repeat || 0;
- this._repeatDelay = this.vars.repeatDelay || 0;
- this._uncache(true);
- return TimelineLite.prototype.invalidate.call(this);
- }
-
- p.addCallback = function(callback, timeOrLabel, params, scope) {
- return this.insert( TweenLite.delayedCall(0, callback, params, scope), timeOrLabel);
- }
-
- p.removeCallback = function(callback, timeOrLabel) {
- if (timeOrLabel == null) {
- this._kill(null, callback);
- } else {
- var a = this.getTweensOf(callback, false),
- i = a.length,
- time = this._parseTimeOrLabel(timeOrLabel, false);
- while (--i > -1) {
- if (a[i]._startTime === time) {
- a[i]._enabled(false, false);
- }
- }
- }
- return this;
- }
-
- p.tweenTo = function(timeOrLabel, vars) {
- vars = vars || {};
- var copy = {ease:_easeNone, overwrite:2, useFrames:this.usesFrames(), immediateRender:false}, p, t;
- for (p in vars) {
- copy[p] = vars[p];
- }
- copy.time = this._parseTimeOrLabel(timeOrLabel, false);
- t = new TweenLite(this, (Math.abs(Number(copy.time) - this._time) / this._timeScale) || 0.001, copy);
- copy.onStart = function() {
- t.target.paused(true);
- if (t.vars.time != t.target.time()) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all.
- t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale );
- }
- if (vars.onStart) { //in case the user had an onStart in the vars - we don't want to overwrite it.
- vars.onStart.apply(vars.onStartScope || t, vars.onStartParams || _blankArray);
- }
- }
- return t;
- }
-
- p.tweenFromTo = function(fromTimeOrLabel, toTimeOrLabel, vars) {
- vars = vars || {};
- vars.startAt = {time:this._parseTimeOrLabel(fromTimeOrLabel, false)};
- var t = this.tweenTo(toTimeOrLabel, vars);
- return t.duration((Math.abs( t.vars.time - t.vars.startAt.time) / this._timeScale) || 0.001);
- }
-
- p.render = function(time, suppressEvents, force) {
- if (this._gc) {
- this._enabled(true, false);
- }
- this._active = !this._paused;
- var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(),
- prevTime = this._time,
- prevTotalTime = this._totalTime,
- prevStart = this._startTime,
- prevTimeScale = this._timeScale,
- prevRawPrevTime = this._rawPrevTime,
- prevPaused = this._paused,
- prevCycle = this._cycle,
- tween, isComplete, next, dur, callback;
- if (time >= totalDur) {
- if (!this._locked) {
- this._totalTime = totalDur;
- this._cycle = this._repeat;
- }
- if (!this._reversed) if (!this._hasPausedChild()) {
- isComplete = true;
- callback = "onComplete";
- if (this._duration === 0) if (time === 0 || this._rawPrevTime < 0) if (this._rawPrevTime !== time) { //In order to accommodate zero-duration timelines, we must discern the momentum/direction of time in order to render values properly when the "playhead" goes past 0 in the forward direction or lands directly on it, and also when it moves past it in the backward direction (from a postitive time to a negative time).
- force = true;
- }
- }
- this._rawPrevTime = time;
- if (this._yoyo && (this._cycle & 1) !== 0) {
- this._time = 0;
- time = -0.000001; //to avoid occassional floating point rounding errors - sometimes child tweens/timelines were not being rendered at the very beginning (their progress might be 0.000000000001 instead of 0 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off)
- } else {
- this._time = this._duration;
- time = this._duration + 0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off)
- }
-
- } else if (time <= 0) {
- if (!this._locked) {
- this._totalTime = this._cycle = 0;
- }
- this._time = 0;
- if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime > 0)) {
- callback = "onReverseComplete";
- isComplete = this._reversed;
- }
- if (time < 0) {
- this._active = false;
- if (this._duration === 0) if (this._rawPrevTime >= 0) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
- force = true;
- }
- } else if (!this._initted) {
- force = true;
- }
- this._rawPrevTime = time;
- time = -0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being rendered at the very beginning (their progress might be 0.000000000001 instead of 0 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off)
-
- } else {
- this._time = this._rawPrevTime = time;
- if (!this._locked) {
- this._totalTime = time;
- if (this._repeat !== 0) {
- var cycleDuration = this._duration + this._repeatDelay;
- this._cycle = (this._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but Flash reports it as 0.79999999!)
- if (this._cycle !== 0) if (this._cycle === this._totalTime / cycleDuration) {
- this._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning)
- }
- this._time = this._totalTime - (this._cycle * cycleDuration);
- if (this._yoyo) if ((this._cycle & 1) != 0) {
- this._time = this._duration - this._time;
- }
- if (this._time > this._duration) {
- this._time = this._duration;
- time = this._duration + 0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off)
- } else if (this._time < 0) {
- this._time = 0;
- time = -0.000001; //to avoid occassional floating point rounding errors in Flash - sometimes child tweens/timelines were not being rendered at the very beginning (their progress might be 0.000000000001 instead of 0 because when Flash performed _time - tween._startTime, floating point errors would return a value that was SLIGHTLY off)
- } else {
- time = this._time;
- }
- }
- }
- }
-
- if (this._cycle !== prevCycle) if (!this._locked) {
- /*
- make sure children at the end/beginning of the timeline are rendered properly. If, for example,
- a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which
- would get transated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there
- could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So
- we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must
- ensure that zero-duration tweens at the very beginning or end of the TimelineMax work.
- */
- var backwards = (this._yoyo && (prevCycle & 1) !== 0),
- wrap = (backwards === (this._yoyo && (this._cycle & 1) !== 0)),
- recTotalTime = this._totalTime,
- recCycle = this._cycle,
- recRawPrevTime = this._rawPrevTime,
- recTime = this._time;
-
- this._totalTime = prevCycle * this._duration;
- if (this._cycle < prevCycle) {
- backwards = !backwards;
- } else {
- this._totalTime += this._duration;
- }
- this._time = prevTime; //temporarily revert _time so that render() renders the children in the correct order. Without this, tweens won't rewind correctly. We could arhictect things in a "cleaner" way by splitting out the rendering queue into a separate method but for performance reasons, we kept it all inside this method.
-
- this._rawPrevTime = prevRawPrevTime;
- this._cycle = prevCycle;
- this._locked = true; //prevents changes to totalTime and skips repeat/yoyo behavior when we recursively call render()
- prevTime = (backwards) ? 0 : this._duration;
- this.render(prevTime, suppressEvents, false);
- if (!suppressEvents) if (!this._gc) {
- if (this.vars.onRepeat) {
- this.vars.onRepeat.apply(this.vars.onRepeatScope || this, this.vars.onRepeatParams || _blankArray);
- }
- }
- if (wrap) {
- prevTime = (backwards) ? this._duration + 0.000001 : -0.000001;
- this.render(prevTime, true, false);
- }
- this._time = recTime;
- this._totalTime = recTotalTime;
- this._cycle = recCycle;
- this._rawPrevTime = recRawPrevTime;
- this._locked = false;
- }
- if (this._time === prevTime && !force) {
- return;
- } else if (!this._initted) {
- this._initted = true;
- }
-
- if (prevTotalTime === 0) if (this.vars.onStart) if (this._totalTime !== 0) if (!suppressEvents) {
- this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray);
- }
-
- if (this._time > prevTime) {
- tween = this._first;
- while (tween) {
- next = tween._next; //record it here because the value could change after rendering...
- if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
- break;
- } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) {
-
- if (!tween._reversed) {
- tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false);
- } else {
- tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false);
- }
-
- }
- tween = next;
- }
- } else {
- tween = this._last;
- while (tween) {
- next = tween._prev; //record it here because the value could change after rendering...
- if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
- break;
- } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) {
-
- if (!tween._reversed) {
- tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, false);
- } else {
- tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, false);
- }
-
- }
- tween = next;
- }
- }
-
- if (this._onUpdate) if (!suppressEvents) {
- this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
- }
-
- if (callback) if (!this._locked) if (!this._gc) if (prevStart === this._startTime || prevTimeScale != this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call a…
Large files files are truncated, but you can click here to view the full file