Skip to content

Commit

Permalink
12.1.5
Browse files Browse the repository at this point in the history
- Fixed bug that could cause zero-duration tweens at the very beginning of a nested timeline not to return to their beginning values if the playhead of the parent timeline goes past the nested timeline's startTime, and then goes back to EXACTLY on top of the startTime, and then before it.

- Improved GC, protecting against a very particular scenario where a user writes bad JS code that maintains a reference to a timeline.

- Fixed issue that could cause TweenMax.killAll() to go to the end of a tween instead of its beginning when it's reversed and the "complete" parameter is true.

- Changed LoaderMax so that it doesn't URL-encode underscores since Facebook uses them.
  • Loading branch information
jackdoyle committed Jul 21, 2014
1 parent 8f54b77 commit 53fe0a9
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 31 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gsap",
"version": "12.1.4",
"version": "12.1.5",
"description": "GreenSock Animation Platform (GSAP) is a suite of high-performance AS3 classes for scripted animation (also available in JavaScript and AS2), including TweenLite, TweenMax, TimelineLite, TimelineMax, various easing equations, and plugins for things like animating along Bezier paths, filters, etc. See http://www.greensock.com/ for details.",
"author": {
"name": "Jack Doyle",
Expand Down
26 changes: 17 additions & 9 deletions src/com/greensock/TimelineLite.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* VERSION: 12.1.4
* DATE: 2014-03-21
* VERSION: 12.1.5
* DATE: 2014-07-19
* AS3 (AS2 version is also available)
* UPDATES AND DOCS AT: http://www.greensock.com/timelinelite/
**/
Expand Down Expand Up @@ -303,7 +303,7 @@ tl.add(nested);
**/
public class TimelineLite extends SimpleTimeline {
/** @private **/
public static const version:String = "12.1.4";
public static const version:String = "12.1.5";

/** @private **/
protected var _labels:Object;
Expand Down Expand Up @@ -1566,7 +1566,7 @@ myAnimation.seek("myLabel");
}
if (time < 0) {
_active = false;
if (_duration == 0) if (_rawPrevTime >= 0 && _first != null) { //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.
if (_rawPrevTime >= 0 && _first != null) { //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.
internalForce = true;
}
_rawPrevTime = time;
Expand Down Expand Up @@ -1708,15 +1708,23 @@ myAnimation.seek("myLabel");
* @return an Array of TweenLite and/or TweenMax instances
*/
public function getTweensOf(target:Object, nested:Boolean=true):Array {
var tweens:Array = TweenLite.getTweensOf(target),
i:int = tweens.length,
a:Array = [],
cnt:int = 0;
var disabled:Boolean = this._gc,
a:Array = [],
cnt:int = 0,
tweens:Array, i:int;
if (disabled) {
_enabled(true, true); //getTweensOf() filters out disabled tweens, and we have to mark them as _gc = true when the timeline completes in order to allow clean garbage collection, so temporarily re-enable the timeline here.
}
tweens = TweenLite.getTweensOf(target);
i = tweens.length;
while (--i > -1) {
if (tweens[i].timeline == this || (nested && _contains(tweens[i]))) {
if (tweens[i].timeline === this || (nested && _contains(tweens[i]))) {
a[cnt++] = tweens[i];
}
}
if (disabled) {
_enabled(false, true);
}
return a;
}

Expand Down
10 changes: 5 additions & 5 deletions src/com/greensock/TimelineMax.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* VERSION: 12.1.4
* DATE: 2014-03-21
* VERSION: 12.1.5
* DATE: 2014-07-19
* AS3 (AS2 version is also available)
* UPDATES AND DOCS AT: http://www.greensock.com/timelinemax/
**/
Expand Down Expand Up @@ -388,7 +388,7 @@ tl.add(nested);
**/
public class TimelineMax extends TimelineLite implements IEventDispatcher {
/** @private **/
public static const version:String = "12.1.4";
public static const version:String = "12.1.5";
/** @private **/
protected static var _listenerLookup:Object = {onCompleteListener:TweenEvent.COMPLETE, onUpdateListener:TweenEvent.UPDATE, onStartListener:TweenEvent.START, onRepeatListener:TweenEvent.REPEAT, onReverseCompleteListener:TweenEvent.REVERSE_COMPLETE};
/** @private **/
Expand Down Expand Up @@ -734,7 +734,7 @@ tl.add(nested);
*/
public function tweenTo(position:*, vars:Object=null):TweenLite {
vars = vars || {};
var copy:Object = {ease:_easeNone, overwrite:2, useFrames:usesFrames(), immediateRender:false};
var copy:Object = {ease:_easeNone, overwrite:(vars.delay ? 2 : 1), useFrames:usesFrames(), immediateRender:false};
for (var p:String in vars) {
copy[p] = vars[p];
}
Expand Down Expand Up @@ -858,7 +858,7 @@ tl.add( myTimeline.tweenFromTo("myLabel2", 0) );
}
if (time < 0) {
_active = false;
if (_duration == 0) if (_rawPrevTime >= 0 && _first) { //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.
if (_rawPrevTime >= 0 && _first) { //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.
internalForce = true;
}
_rawPrevTime = time;
Expand Down
6 changes: 3 additions & 3 deletions src/com/greensock/TweenLite.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* VERSION: 12.1.4
* DATE: 2014-03-19
* VERSION: 12.1.5
* DATE: 2014-07-19
* AS3 (AS2 version is also available)
* UPDATES AND DOCS AT: http://www.greensock.com
**/
Expand Down Expand Up @@ -304,7 +304,7 @@ package com.greensock {
public class TweenLite extends Animation {

/** @private **/
public static const version:String = "12.1.4";
public static const version:String = "12.1.5";

/** Provides An easy way to change the default easing equation. Choose from any of the GreenSock eases in the <code>com.greensock.easing</code> package. @default Power1.easeOut **/
public static var defaultEase:Ease = new Ease(null, null, 1, 1);
Expand Down
8 changes: 4 additions & 4 deletions src/com/greensock/TweenMax.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* VERSION: 12.1.4
* DATE: 2014-03-19
* VERSION: 12.1.5
* DATE: 2014-07-19
* AS3 (AS2 version is also available)
* UPDATES AND DOCS AT: http://www.greensock.com
**/
Expand Down Expand Up @@ -530,7 +530,7 @@ package com.greensock {
*/
public class TweenMax extends TweenLite implements IEventDispatcher {
/** @private **/
public static const version:String = "12.1.4";
public static const version:String = "12.1.5";

TweenPlugin.activate([

Expand Down Expand Up @@ -1635,7 +1635,7 @@ TweenMax.killAll(false, false, true, false);
tween = a[i];
if (allTrue || (tween is SimpleTimeline) || ((isDC = (TweenLite(tween).target == TweenLite(tween).vars.onComplete)) && delayedCalls) || (tweens && !isDC)) {
if (complete) {
tween.totalTime(tween.totalDuration());
tween.totalTime(tween._reversed ? 0 : tween.totalDuration());
} else {
tween._enabled(false, false);
}
Expand Down
6 changes: 3 additions & 3 deletions src/com/greensock/core/SimpleTimeline.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* VERSION: 12.0.3
* DATE: 2013-02-28
* VERSION: 12.0.4
* DATE: 2014-07-08
* AS3 (AS2 version is also available)
* UPDATES AND DOCS AT: http://www.greensock.com
**/
Expand Down Expand Up @@ -135,7 +135,6 @@ package com.greensock.core {
if (!skipDisable) {
tween._enabled(false, true);
}
tween.timeline = null;

if (tween._prev) {
tween._prev._next = tween._next;
Expand All @@ -147,6 +146,7 @@ package com.greensock.core {
} else if (_last === tween) {
_last = tween._prev;
}
tween._next = tween._prev = tween.timeline = null;

if (_timeline) {
_uncache(true);
Expand Down
6 changes: 3 additions & 3 deletions src/com/greensock/loading/LoaderMax.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* VERSION: 1.938
* DATE: 2013-07-16
* VERSION: 1.939
* DATE: 2014-06-26
* AS3
* UPDATES AND DOCS AT: http://www.greensock.com/loadermax/
**/
Expand Down Expand Up @@ -143,7 +143,7 @@ function errorHandler(event:LoaderEvent):void {
*/
public class LoaderMax extends LoaderCore {
/** @private **/
public static const version:Number = 1.938;
public static const version:Number = 1.939;
/** The default value that will be used for the <code>estimatedBytes</code> on loaders that don't declare one in the <code>vars</code> parameter of the constructor. **/
public static var defaultEstimatedBytes:uint = 20000;
/** Controls the default value of <code>auditSize</code> in LoaderMax instances (normally <code>true</code>). For most situations, the auditSize feature is very convenient for ensuring that the overall progress of LoaderMax instances is reported accurately, but when working with very large quantities of files that have no <code>estimatedBytes</code> defined, some developers prefer to turn auditSize off by default. Of course you can always override the default for individual LoaderMax instances by defining an <code>auditSize</code> value in the <code>vars</code> parameter of the constructor. **/
Expand Down
8 changes: 5 additions & 3 deletions src/com/greensock/loading/core/LoaderItem.as
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* VERSION: 1.936
* DATE: 2013-10-28
* VERSION: 1.937
* DATE: 2014-06-26
* AS3
* UPDATES AND DOCS AT: http://www.greensock.com/loadermax/
**/
Expand Down Expand Up @@ -29,6 +29,8 @@ package com.greensock.loading.core {
public class LoaderItem extends LoaderCore {
/** @private **/
protected static var _cacheID:Number = new Date().getTime();
/** @private **/
protected static var _underlineExp:RegExp = /%5f/gi;

/** @private **/
protected var _url:String;
Expand Down Expand Up @@ -92,7 +94,7 @@ package com.greensock.loading.core {
pair = a[i].split("=");
data[pair.shift()] = pair.join("=");
}
request.data = data;
request.data = data.toString().replace(_underlineExp, "_");
}
if (_isLocal && this.vars.allowMalformedURL != true && _request.data != null && _request.url.substr(0, 4) != "http") {
_request.method = "POST"; //to avoid errors when loading local files with GET URL parameters
Expand Down

0 comments on commit 53fe0a9

Please sign in to comment.