@@ -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} ) ( ) ;
0 commit comments