Skip to content

Commit

Permalink
12.0.2
Browse files Browse the repository at this point in the history
- Fixed issue that could cause fromTo() tweens in a TimelineLite/Max
not to revert to their initial values (even before the "from" part)
when the timeline is rewound past the startTime of the fromTo() tween.

- Fixed issue that could cause the onFail event of a child of a
LoaderMax not to propagate up through the LoaderMax instance.

- Added data to the HTTP_STATUS LoaderEvent so that you can check the
status value directly on the LoaderEvent.text and the original event is
referenced on the LoaderEvent.data.

- XMLLoader now recognizes the allowMalformedURL special property.
  • Loading branch information
jackdoyle committed Feb 24, 2013
1 parent 4a31592 commit 9cd6e31
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 41 deletions.
10 changes: 5 additions & 5 deletions src/com/greensock/TimelineLite.as
@@ -1,6 +1,6 @@
/**
* VERSION: 12.0.1
* DATE: 2013-02-13
* VERSION: 12.0.2
* DATE: 2013-02-21
* AS3 (AS2 version is also available)
* UPDATES AND DOCS AT: http://www.greensock.com/timelinelite/
**/
Expand Down Expand Up @@ -276,7 +276,7 @@ tl.add(nested);
**/
public class TimelineLite extends SimpleTimeline {
/** @private **/
public static const version:String = "12.0.1";
public static const version:String = "12.0.2";
/** @private **/
protected static const _paramProps:Array = ["onStartParams","onUpdateParams","onCompleteParams","onReverseCompleteParams","onRepeatParams"];

Expand Down Expand Up @@ -1127,8 +1127,8 @@ tl.add([tween1, tween2, tween3], "+=2", "stagger", 0.5);
*
* @param value The tween, timeline, callback, or label (or array of them) to add
* @param position Controls the placement of the object in the timeline (by default, it's the end of the timeline, like "+=0"). Use a number to indicate an absolute time in terms of seconds (or frames for frames-based timelines), or you can use a string with a "+=" or "-=" prefix to offset the insertion point relative to the END of the timeline. For example, <code>"+=2"</code> would place the object 2 seconds after the end, leaving a 2-second gap. <code>"-=2"</code> would create a 2-second overlap. You may also use a label like <code>"myLabel"</code> to have the object inserted exactly at the label or combine a label and a relative offset like <code>"myLabel+=2"</code> to insert the object 2 seconds after "myLabel" or <code>"myLabel-=3"</code> to insert it 3 seconds before "myLabel". If you define a label that doesn't exist yet, it will <strong>automatically be added to the end of the timeline</strong> before inserting the tween there which can be quite convenient.
* @param align Determines how the tweens/timelines/callbacks/labels will be aligned in relation to each other before getting inserted. Options are: <code>"sequence"</code> (aligns them one-after-the-other in a sequence), <code>"start"</code> (aligns the start times of all of the objects (ignoring delays)), and <code>"normal"</code> (aligns the start times of all the tweens (honoring delays)). The default is <code>"normal"</code>.
* @param stagger 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 <code>"align"</code> parameter is set to <code>"start"</code>, 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 <code>"sequence"</code>, there would be 0.5 seconds added between each tween. Default is 0.
* @param align <strong><i>[only relevant when the first parameter, <code>value</code>, is an array]</i></strong> Determines how the tweens/timelines/callbacks/labels in the array that is being added will be aligned in relation to each other before getting inserted. Options are: <code>"sequence"</code> (aligns them one-after-the-other in a sequence), <code>"start"</code> (aligns the start times of all of the objects (ignoring delays)), and <code>"normal"</code> (aligns the start times of all the tweens (honoring delays)). The default is <code>"normal"</code>.
* @param stagger <strong><i>[only relevant when the first parameter, <code>value</code>, is an array]</i></strong> Staggers the inserted objects from the array the is being added 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 <code>"align"</code> parameter is set to <code>"start"</code>, 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 <code>"sequence"</code>, there would be 0.5 seconds added between each tween. Default is 0.
* @return self (makes chaining easier)
*/
override public function add(value:*, position:*="+=0", align:String="normal", stagger:Number=0):* {
Expand Down
6 changes: 3 additions & 3 deletions src/com/greensock/TimelineMax.as
@@ -1,6 +1,6 @@
/**
* VERSION: 12.0.1
* DATE: 2013-02-13
* VERSION: 12.0.2
* DATE: 2013-02-21
* AS3 (AS2 version is also available)
* UPDATES AND DOCS AT: http://www.greensock.com/timelinemax/
**/
Expand Down Expand Up @@ -361,7 +361,7 @@ tl.add(nested);
**/
public class TimelineMax extends TimelineLite implements IEventDispatcher {
/** @private **/
public static const version:String = "12.0.1";
public static const version:String = "12.0.2";
/** @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
32 changes: 24 additions & 8 deletions src/com/greensock/TweenLite.as
@@ -1,6 +1,6 @@
/**
* VERSION: 12.0.1
* DATE: 2013-02-13
* VERSION: 12.0.2
* DATE: 2013-02-21
* 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.0.1";
public static const version:String = "12.0.2";

/** 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 Expand Up @@ -430,6 +430,9 @@ package com.greensock {
/** @private If this tween has any TweenPlugins that need to be notified of a change in the "enabled" status, this will be true. (speeds things up in the _enable() setter) **/
protected var _notifyPluginsOfEnabled:Boolean;

/** @private Only used in tweens where a startAt is defined (like fromTo() tweens) so that we can record the pre-tween starting values and revert to them properly if/when the playhead on the timeline moves backwards, before this tween started. In other words, if alpha is at 1 and then someone does a fromTo() tween that makes it go from 0 to 1 and then the playhead moves BEFORE that tween, alpha should jump back to 1 instead of reverting to 0. **/
protected var _startAt:TweenLite;


/**
* Constructor
Expand Down Expand Up @@ -493,7 +496,7 @@ package com.greensock {
if (vars.startAt) {
vars.startAt.overwrite = 0;
vars.startAt.immediateRender = true;
TweenLite.to(target, 0, vars.startAt);
_startAt = new TweenLite(target, 0, vars.startAt);
}
var i:int, initPlugins:Boolean, pt:PropTween;
if (vars.ease is Ease) {
Expand Down Expand Up @@ -670,8 +673,13 @@ package com.greensock {
if (!_active) if (!_paused) {
_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 (prevTime == 0) if (vars.onStart) if (_time != 0 || _duration == 0) if (!suppressEvents) {
vars.onStart.apply(null, vars.onStartParams);
if (prevTime == 0) {
if (_startAt != null) {
_startAt.render(time, suppressEvents, force);
}
if (vars.onStart) if (_time != 0 || _duration == 0) if (!suppressEvents) {
vars.onStart.apply(null, vars.onStartParams);
}
}

pt = _firstPT;
Expand All @@ -684,11 +692,19 @@ package com.greensock {
pt = pt._next;
}

if (_onUpdate != null) if (!suppressEvents) {
_onUpdate.apply(null, vars.onUpdateParams);
if (_onUpdate != null) {
if (time < 0 && _startAt != null) {
_startAt.render(time, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.
}
if (!suppressEvents) {
_onUpdate.apply(null, vars.onUpdateParams);
}
}

if (callback) if (!_gc) { //check gc because there's a chance that kill() could be called in an onUpdate
if (time < 0 && _startAt != null && _onUpdate == null) {
_startAt.render(time, suppressEvents, force);
}
if (isComplete) {
if (_timeline.autoRemoveChildren) {
_enabled(false, false);
Expand Down
42 changes: 30 additions & 12 deletions src/com/greensock/TweenMax.as
@@ -1,6 +1,6 @@
/**
* VERSION: 12.0.1
* DATE: 2013-02-13
* VERSION: 12.0.2
* DATE: 2013-02-21
* 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.0.0";
public static const version:String = "12.0.2";

TweenPlugin.activate([

Expand Down Expand Up @@ -964,12 +964,17 @@ tween.updateTo({x:300, y:0}, false);
if (!_active) if (!_paused) {
_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 (_totalTime != 0 || _duration == 0) if (!suppressEvents) {
if (vars.onStart) {
vars.onStart.apply(null, vars.onStartParams);
if (prevTotalTime == 0) {
if (_startAt != null) {
_startAt.render(time, suppressEvents, force);
}
if (_dispatcher) {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
if (_totalTime != 0 || _duration == 0) if (!suppressEvents) {
if (vars.onStart) {
vars.onStart.apply(null, vars.onStartParams);
}
if (_dispatcher) {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
}
}

Expand All @@ -983,11 +988,21 @@ tween.updateTo({x:300, y:0}, false);
pt = pt._next;
}

if (_onUpdate != null) if (!suppressEvents) {
_onUpdate.apply(null, vars.onUpdateParams);
if (_onUpdate != null) {
if (time < 0 && _startAt != null) {
_startAt.render(time, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.
}
if (!suppressEvents) {
_onUpdate.apply(null, vars.onUpdateParams);
}
}
if (_hasUpdateListener) if (!suppressEvents) {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
if (_hasUpdateListener) {
if (time < 0 && _startAt != null && _onUpdate == null) {
_startAt.render(time, suppressEvents, force);
}
if (!suppressEvents) {
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
}
if (_cycle != prevCycle) if (!suppressEvents) if (!_gc) {
if (vars.onRepeat) {
Expand All @@ -998,6 +1013,9 @@ tween.updateTo({x:300, y:0}, false);
}
}
if (callback) if (!_gc) { //check gc because there's a chance that kill() could be called in an onUpdate
if (time < 0 && _startAt != null && _onUpdate == null && !_hasUpdateListener) {
_startAt.render(time, suppressEvents, true);
}
if (isComplete) {
if (_timeline.autoRemoveChildren) {
_enabled(false, false);
Expand Down
6 changes: 3 additions & 3 deletions src/com/greensock/loading/LoaderMax.as
@@ -1,6 +1,6 @@
/**
* VERSION: 1.931
* DATE: 2013-01-08
* VERSION: 1.933
* DATE: 2013-02-22
* 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.931;
public static const version:Number = 1.933;
/** 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
6 changes: 3 additions & 3 deletions src/com/greensock/loading/XMLLoader.as
@@ -1,6 +1,6 @@
/**
* VERSION: 1.931
* DATE: 2013-01-08
* VERSION: 1.932
* DATE: 2013-02-21
* AS3
* UPDATES AND DOCS AT: http://www.greensock.com/loadermax/
**/
Expand Down Expand Up @@ -229,7 +229,7 @@ function completeHandler(event:LoaderEvent):void {
/** @private **/
private static var _classActivated:Boolean = _activateClass("XMLLoader", XMLLoader, "xml,php,jsp,asp,cfm,cfml,aspx");
/** @private Any non-String variable types that XMLLoader should recognized in loader nodes like <ImageLoader>, <VideoLoader>, etc. **/
protected static var _varTypes:Object = {skipFailed:true, skipPaused:true, autoLoad:false, paused:false, load:false, noCache:false, maxConnections:2, autoPlay:false, autoDispose:false, smoothing:false, autoDetachNetStream:false, estimatedBytes:1, x:1, y:1, z:1, rotationX:1, rotationY:1, rotationZ:1, width:1, height:1, scaleX:1, scaleY:1, rotation:1, alpha:1, visible:true, bgColor:0, bgAlpha:0, deblocking:1, repeat:1, checkPolicyFile:false, centerRegistration:false, bufferTime:5, volume:1, bufferMode:false, estimatedDuration:200, crop:false, autoAdjustBuffer:true, suppressInitReparentEvents:true};
protected static var _varTypes:Object = {skipFailed:true, skipPaused:true, autoLoad:false, paused:false, load:false, noCache:false, maxConnections:2, autoPlay:false, autoDispose:false, smoothing:false, autoDetachNetStream:false, estimatedBytes:1, x:1, y:1, z:1, rotationX:1, rotationY:1, rotationZ:1, width:1, height:1, scaleX:1, scaleY:1, rotation:1, alpha:1, visible:true, bgColor:0, bgAlpha:0, deblocking:1, repeat:1, checkPolicyFile:false, centerRegistration:false, bufferTime:5, volume:1, bufferMode:false, estimatedDuration:200, crop:false, autoAdjustBuffer:true, suppressInitReparentEvents:true, allowMalformedURL:false};
/** Event type constant for when the XML has loaded but has <b>not</b> been parsed yet. This can be useful in rare situations when you want to alter the XML before it is parsed by XMLLoader (for identifying LoaderMax-related nodes like <code>&lt;ImageLoader&gt;</code>, etc.) **/
public static var RAW_LOAD:String = "rawLoad";
/** @private contains only the parsed loaders that had the load="true" XML attribute. It also contains the _parsed LoaderMax which is paused, so it won't load (we put it in there for easy searching). **/
Expand Down
7 changes: 7 additions & 0 deletions src/com/greensock/loading/changelog.txt
@@ -1,5 +1,12 @@
CHANGE LOG : GREENSOCK LOADERMAX SYSTEM
----------------------------------------
2013-02-21
----------------------------------------
XMLLoader 1.932
LoaderItem 1.932
LoaderMax 1.932
- Added ability for XMLLoader to recognize "allowMalformedURL" in XML nodes
- To avoid errors when attempting to load local files, if allowMalformedURL isn't true and there are parameters in the query string, the URLRequest's method will be forced to "POST" (again, ONLY when the swf is running locally, not on the network)

2013-01-08
----------------------------------------
Expand Down
9 changes: 5 additions & 4 deletions src/com/greensock/loading/core/LoaderCore.as
@@ -1,6 +1,6 @@
/**
* VERSION: 1.8993
* DATE: 2012-02-24
* VERSION: 1.933
* DATE: 2013-02-22
* AS3
* UPDATES AND DOCS AT: http://www.greensock.com/loadermax/
**/
Expand Down Expand Up @@ -42,7 +42,7 @@ package com.greensock.loading.core {
*/
public class LoaderCore extends EventDispatcher {
/** @private **/
public static const version:Number = 1.87;
public static const version:Number = 1.933;

/** @private **/
protected static var _loaderCount:uint = 0;
Expand Down Expand Up @@ -424,13 +424,14 @@ package com.greensock.loading.core {

/** @private **/
protected function _failHandler(event:Event, dispatchError:Boolean=true):void {
_dump(0, LoaderStatus.FAILED);
_dump(0, LoaderStatus.FAILED, true);
if (dispatchError) {
_errorHandler(event);
} else {
var target:Object = event.target; //trigger the LoaderEvent's target getter once first in order to ensure that it reports properly - see the notes in LoaderEvent.target for more details.
}
dispatchEvent(new LoaderEvent(LoaderEvent.FAIL, ((event is LoaderEvent && this.hasOwnProperty("getChildren")) ? event.target : this), this.toString() + " > " + (event as Object).text, event));
dispatchEvent(new LoaderEvent(LoaderEvent.CANCEL, this));
}

/** @private **/
Expand Down
9 changes: 6 additions & 3 deletions src/com/greensock/loading/core/LoaderItem.as
@@ -1,6 +1,6 @@
/**
* VERSION: 1.921
* DATE: 2012-10-10
* VERSION: 1.932
* DATE: 2013-02-22
* AS3
* UPDATES AND DOCS AT: http://www.greensock.com/loadermax/
**/
Expand Down Expand Up @@ -94,6 +94,9 @@ package com.greensock.loading.core {
}
request.data = data;
}
if (_isLocal && this.vars.allowMalformedURL != true && _request.data != null) {
_request.method = "POST"; //to avoid errors when loading local files with GET URL parameters
}
}

/** @private scrubLevel: 0 = cancel, 1 = unload, 2 = dispose, 3 = flush **/
Expand Down Expand Up @@ -182,7 +185,7 @@ package com.greensock.loading.core {
/** @private **/
protected function _httpStatusHandler(event:Event):void {
_httpStatus = (event as Object).status;
dispatchEvent(new LoaderEvent(LoaderEvent.HTTP_STATUS, this));
dispatchEvent(new LoaderEvent(LoaderEvent.HTTP_STATUS, this, String(_httpStatus), event));
}


Expand Down

0 comments on commit 9cd6e31

Please sign in to comment.