Skip to content

Commit d59298c

Browse files
author
Lanny McNie
committed
Updated NEXT docs and libs
1 parent b15c866 commit d59298c

6 files changed

+108
-31
lines changed

docs/easeljs_docs-NEXT.zip

4.05 KB
Binary file not shown.

lib/easeljs-NEXT.combined.js

+33-12
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ this.createjs = this.createjs||{};
4444
*
4545
* function MySubClass() {}
4646
* createjs.extend(MySubClass, MySuperClass);
47-
* ClassB.prototype.doSomething = function() { }
47+
* MySubClass.prototype.doSomething = function() { }
4848
*
4949
* var foo = new MySubClass();
5050
* console.log(foo instanceof MySuperClass); // true
@@ -539,7 +539,11 @@ this.createjs = this.createjs||{};
539539
* only run once, associate arbitrary data with the listener, and remove the listener.
540540
*
541541
* This method works by creating an anonymous wrapper function and subscribing it with addEventListener.
542-
* The created anonymous function is returned for use with .removeEventListener (or .off).
542+
* The wrapper function is returned for use with `removeEventListener` (or `off`).
543+
*
544+
* <b>IMPORTANT:</b> To remove a listener added with `on`, you must pass in the returned wrapper function as the listener, or use
545+
* {{#crossLink "Event/remove"}}{{/crossLink}}. Likewise, each time you call `on` a NEW wrapper function is subscribed, so multiple calls
546+
* to `on` with the same params will create multiple listeners.
543547
*
544548
* <h4>Example</h4>
545549
*
@@ -609,6 +613,9 @@ this.createjs = this.createjs||{};
609613
/**
610614
* A shortcut to the removeEventListener method, with the same parameters and return value. This is a companion to the
611615
* .on method.
616+
*
617+
* <b>IMPORTANT:</b> To remove a listener added with `on`, you must pass in the returned wrapper function as the listener. See
618+
* {{#crossLink "EventDispatcher/on"}}{{/crossLink}} for an example.
612619
*
613620
* @method off
614621
* @param {String} type The string type of the event.
@@ -1068,7 +1075,7 @@ this.createjs = this.createjs||{};
10681075
};
10691076

10701077
/**
1071-
* Use the {{#crossLink "Ticker/framerate:property"}}{{/crossLink}} property instead.
1078+
* Use the {{#crossLink "Ticker/interval:property"}}{{/crossLink}} property instead.
10721079
* @method getInterval
10731080
* @static
10741081
* @return {Number}
@@ -1090,7 +1097,7 @@ this.createjs = this.createjs||{};
10901097
};
10911098

10921099
/**
1093-
* Use the {{#crossLink "Ticker/interval:property"}}{{/crossLink}} property instead.
1100+
* Use the {{#crossLink "Ticker/framerate:property"}}{{/crossLink}} property instead.
10941101
* @method getFPS
10951102
* @static
10961103
* @return {Number}
@@ -1242,7 +1249,8 @@ this.createjs = this.createjs||{};
12421249
};
12431250

12441251
/**
1245-
* Similar to getTime(), but returns the time on the most recent tick event object.
1252+
* Similar to the {{#crossLink "Ticker/getTime"}}{{/crossLink}} method, but returns the time on the most recent {{#crossLink "Ticker/tick:event"}}{{/crossLink}}
1253+
* event object.
12461254
* @method getEventTime
12471255
* @static
12481256
* @param runTime {Boolean} [runTime=false] If true, the runTime property will be returned instead of time.
@@ -2701,7 +2709,6 @@ this.createjs = this.createjs||{};
27012709
* @protected
27022710
**/
27032711
this._enabled = false;
2704-
27052712

27062713
// setup:
27072714
target.mouseChildren = false; // prevents issues when children are removed from the display list when state changes.
@@ -2748,12 +2755,14 @@ this.createjs = this.createjs||{};
27482755
o.addEventListener("rollout", this);
27492756
o.addEventListener("mousedown", this);
27502757
o.addEventListener("pressup", this);
2758+
if (o._reset) { o.__reset = o._reset; o._reset = this._reset;}
27512759
} else {
27522760
o.cursor = null;
27532761
o.removeEventListener("rollover", this);
27542762
o.removeEventListener("rollout", this);
27552763
o.removeEventListener("mousedown", this);
27562764
o.removeEventListener("pressup", this);
2765+
if (o.__reset) { o._reset = o.__reset; delete(o.__reset); }
27572766
}
27582767
};
27592768
/**
@@ -2816,6 +2825,18 @@ this.createjs = this.createjs||{};
28162825
t.gotoAndStop&&t.gotoAndStop(label);
28172826
}
28182827
};
2828+
2829+
/**
2830+
* Injected into target. Preserves the paused state through a reset.
2831+
* @method _reset
2832+
* @protected
2833+
**/
2834+
p._reset = function() {
2835+
// TODO: explore better ways to handle this issue. This is hacky & disrupts object signatures.
2836+
var p = this.paused;
2837+
this.__reset();
2838+
this.paused = p;
2839+
};
28192840

28202841

28212842
createjs.ButtonHelper = ButtonHelper;
@@ -3341,7 +3362,7 @@ this.createjs = this.createjs||{};
33413362
img.src = src;
33423363
}
33433364
a.push(img);
3344-
if (!img.getContext && !img.complete) {
3365+
if (!img.getContext && !img.naturalWidth) {
33453366
this._loadCount++;
33463367
this.complete = false;
33473368
(function(o) { img.onload = function() { o._handleImageLoad(); } })(this);
@@ -5410,7 +5431,7 @@ this.createjs = this.createjs||{};
54105431
* @return {Fill} Returns this Fill object for chaining or assignment.
54115432
*/
54125433
p.bitmap = function(image, repetition) {
5413-
if (image.complete || image.getContext || image.readyState >= 2) {
5434+
if (image.naturalWidth || image.getContext || image.readyState >= 2) {
54145435
var o = this.style = Graphics._ctx.createPattern(image, repetition || "");
54155436
o.props = {image: image, repetition: repetition, type: "bitmap"};
54165437
}
@@ -7331,7 +7352,7 @@ this.createjs = this.createjs||{};
73317352
*
73327353
* <h4>Example</h4>
73337354
*
7334-
* container.removeAlLChildren();
7355+
* container.removeAllChildren();
73357356
*
73367357
* @method removeAllChildren
73377358
**/
@@ -8725,8 +8746,8 @@ this.createjs = this.createjs||{};
87258746
p.getBounds = function() {
87268747
var rect = this.DisplayObject_getBounds();
87278748
if (rect) { return rect; }
8728-
var o = this.sourceRect || this.image;
8729-
var hasContent = (this.image && (this.image.complete || this.image.getContext || this.image.readyState >= 2));
8749+
var image = this.image, o = this.sourceRect || image;
8750+
var hasContent = (image && (image.naturalWidth || image.getContext || image.readyState >= 2));
87308751
return hasContent ? this._rectangle.setValues(0, 0, o.width, o.height) : null;
87318752
};
87328753

@@ -12579,6 +12600,6 @@ this.createjs = this.createjs || {};
1257912600
* @type String
1258012601
* @static
1258112602
**/
12582-
s.buildDate = /*=date*/"Wed, 18 Mar 2015 15:39:42 GMT"; // injected by build process
12603+
s.buildDate = /*=date*/"Wed, 27 May 2015 18:12:21 GMT"; // injected by build process
1258312604

1258412605
})();

lib/easeljs-NEXT.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/movieclip-NEXT.combined.js

+68-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
/*!
2+
* EaselJS
3+
* Visit http://createjs.com/ for documentation, updates and examples.
4+
*
5+
* Copyright (c) 2010 gskinner.com, inc.
6+
*
7+
* Permission is hereby granted, free of charge, to any person
8+
* obtaining a copy of this software and associated documentation
9+
* files (the "Software"), to deal in the Software without
10+
* restriction, including without limitation the rights to use,
11+
* copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the
13+
* Software is furnished to do so, subject to the following
14+
* conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be
17+
* included in all copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
21+
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23+
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26+
* OTHER DEALINGS IN THE SOFTWARE.
27+
*/
128

229

330
//##############################################################################
@@ -178,7 +205,7 @@ this.createjs = this.createjs||{};
178205
* passed into {{#crossLink "Stage/update"}}{{/crossLink}}.
179206
* @property framerate
180207
* @type {Number}
181-
* @default 0
208+
* @default null
182209
**/
183210
this.framerate = null;
184211

@@ -295,6 +322,16 @@ this.createjs = this.createjs||{};
295322
this._updateTimeline();
296323
return this.timeline.getCurrentLabel();
297324
};
325+
326+
/**
327+
* Use the {{#crossLink "MovieClip/duration:property"}}{{/crossLink}} property instead.
328+
* @method getDuration
329+
* @return {Number}
330+
* @protected
331+
**/
332+
p.getDuration = function() {
333+
return this.timeline.duration;
334+
};
298335

299336
/**
300337
* Returns an array of objects with label and position (aka frame) properties, sorted by position.
@@ -303,18 +340,35 @@ this.createjs = this.createjs||{};
303340
* @type {Array}
304341
* @readonly
305342
**/
306-
343+
307344
/**
308345
* Returns the name of the label on or immediately before the current frame. See TweenJS: Timeline.getCurrentLabel()
309346
* for more information.
310347
* @property currentLabel
311348
* @type {String}
312349
* @readonly
313350
**/
351+
352+
/**
353+
* Returns the duration of this MovieClip in seconds or ticks. Identical to {{#crossLink "MovieClip/duration:property"}}{{/crossLink}}
354+
* and provided for Flash API compatibility.
355+
* @property totalFrames
356+
* @type {Number}
357+
* @readonly
358+
**/
359+
360+
/**
361+
* Returns the duration of this MovieClip in seconds or ticks.
362+
* @property duration
363+
* @type {Number}
364+
* @readonly
365+
**/
314366
try {
315367
Object.defineProperties(p, {
316368
labels: { get: p.getLabels },
317-
currentLabel: { get: p.getCurrentLabel }
369+
currentLabel: { get: p.getCurrentLabel },
370+
totalFrames: { get: p.getDuration },
371+
duration: { get: p.getDuration }
318372
});
319373
} catch (e) {}
320374

@@ -472,8 +526,8 @@ this.createjs = this.createjs||{};
472526
**/
473527
p._reset = function() {
474528
this._prevPos = -1;
475-
this._t = 0;
476-
this.currentFrame = 0;
529+
this._t = this.currentFrame = 0;
530+
this.paused = false;
477531
};
478532

479533
/**
@@ -484,13 +538,15 @@ this.createjs = this.createjs||{};
484538
var tl = this.timeline;
485539
var synched = this.mode != MovieClip.INDEPENDENT;
486540
tl.loop = (this.loop==null) ? true : this.loop;
487-
541+
542+
var pos = synched ? this.startPosition + (this.mode==MovieClip.SINGLE_FRAME?0:this._synchOffset) : (this._prevPos < 0 ? 0 : this._prevPosition);
543+
var mode = synched || !this.actionsEnabled ? createjs.Tween.NONE : null;
544+
545+
// pre-assign currentFrame so it is available to frame scripts:
546+
this.currentFrame = tl._calcPosition(pos);
547+
488548
// update timeline position, ignoring actions if this is a graphic.
489-
if (synched) {
490-
tl.setPosition(this.startPosition + (this.mode==MovieClip.SINGLE_FRAME?0:this._synchOffset), createjs.Tween.NONE);
491-
} else {
492-
tl.setPosition(this._prevPos < 0 ? 0 : this._prevPosition, this.actionsEnabled ? null : createjs.Tween.NONE);
493-
}
549+
tl.setPosition(pos, mode);
494550

495551
this._prevPosition = tl._prevPosition;
496552
if (this._prevPos == tl._prevPos) { return; }
@@ -677,6 +733,6 @@ this.createjs = this.createjs || {};
677733
* @type String
678734
* @static
679735
**/
680-
s.buildDate = /*=date*/"Wed, 24 Dec 2014 17:51:55 GMT"; // injected by build process
736+
s.buildDate = /*=date*/"Wed, 27 May 2015 18:12:21 GMT"; // injected by build process
681737

682738
})();

lib/movieclip-NEXT.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/webgl-NEXT.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)