@@ -44,7 +44,7 @@ this.createjs = this.createjs||{};
44
44
*
45
45
* function MySubClass() {}
46
46
* createjs.extend(MySubClass, MySuperClass);
47
- * ClassB .prototype.doSomething = function() { }
47
+ * MySubClass .prototype.doSomething = function() { }
48
48
*
49
49
* var foo = new MySubClass();
50
50
* console.log(foo instanceof MySuperClass); // true
@@ -539,7 +539,11 @@ this.createjs = this.createjs||{};
539
539
* only run once, associate arbitrary data with the listener, and remove the listener.
540
540
*
541
541
* 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.
543
547
*
544
548
* <h4>Example</h4>
545
549
*
@@ -609,6 +613,9 @@ this.createjs = this.createjs||{};
609
613
/**
610
614
* A shortcut to the removeEventListener method, with the same parameters and return value. This is a companion to the
611
615
* .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.
612
619
*
613
620
* @method off
614
621
* @param {String } type The string type of the event.
@@ -1068,7 +1075,7 @@ this.createjs = this.createjs||{};
1068
1075
} ;
1069
1076
1070
1077
/**
1071
- * Use the {{#crossLink "Ticker/framerate :property"}}{{/crossLink}} property instead.
1078
+ * Use the {{#crossLink "Ticker/interval :property"}}{{/crossLink}} property instead.
1072
1079
* @method getInterval
1073
1080
* @static
1074
1081
* @return {Number }
@@ -1090,7 +1097,7 @@ this.createjs = this.createjs||{};
1090
1097
} ;
1091
1098
1092
1099
/**
1093
- * Use the {{#crossLink "Ticker/interval :property"}}{{/crossLink}} property instead.
1100
+ * Use the {{#crossLink "Ticker/framerate :property"}}{{/crossLink}} property instead.
1094
1101
* @method getFPS
1095
1102
* @static
1096
1103
* @return {Number }
@@ -1242,7 +1249,8 @@ this.createjs = this.createjs||{};
1242
1249
} ;
1243
1250
1244
1251
/**
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.
1246
1254
* @method getEventTime
1247
1255
* @static
1248
1256
* @param runTime {Boolean} [runTime=false] If true, the runTime property will be returned instead of time.
@@ -2701,7 +2709,6 @@ this.createjs = this.createjs||{};
2701
2709
* @protected
2702
2710
**/
2703
2711
this . _enabled = false ;
2704
-
2705
2712
2706
2713
// setup:
2707
2714
target . mouseChildren = false ; // prevents issues when children are removed from the display list when state changes.
@@ -2748,12 +2755,14 @@ this.createjs = this.createjs||{};
2748
2755
o . addEventListener ( "rollout" , this ) ;
2749
2756
o . addEventListener ( "mousedown" , this ) ;
2750
2757
o . addEventListener ( "pressup" , this ) ;
2758
+ if ( o . _reset ) { o . __reset = o . _reset ; o . _reset = this . _reset ; }
2751
2759
} else {
2752
2760
o . cursor = null ;
2753
2761
o . removeEventListener ( "rollover" , this ) ;
2754
2762
o . removeEventListener ( "rollout" , this ) ;
2755
2763
o . removeEventListener ( "mousedown" , this ) ;
2756
2764
o . removeEventListener ( "pressup" , this ) ;
2765
+ if ( o . __reset ) { o . _reset = o . __reset ; delete ( o . __reset ) ; }
2757
2766
}
2758
2767
} ;
2759
2768
/**
@@ -2816,6 +2825,18 @@ this.createjs = this.createjs||{};
2816
2825
t . gotoAndStop && t . gotoAndStop ( label ) ;
2817
2826
}
2818
2827
} ;
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
+ } ;
2819
2840
2820
2841
2821
2842
createjs . ButtonHelper = ButtonHelper ;
@@ -3341,7 +3362,7 @@ this.createjs = this.createjs||{};
3341
3362
img . src = src ;
3342
3363
}
3343
3364
a . push ( img ) ;
3344
- if ( ! img . getContext && ! img . complete ) {
3365
+ if ( ! img . getContext && ! img . naturalWidth ) {
3345
3366
this . _loadCount ++ ;
3346
3367
this . complete = false ;
3347
3368
( function ( o ) { img . onload = function ( ) { o . _handleImageLoad ( ) ; } } ) ( this ) ;
@@ -5410,7 +5431,7 @@ this.createjs = this.createjs||{};
5410
5431
* @return {Fill } Returns this Fill object for chaining or assignment.
5411
5432
*/
5412
5433
p . bitmap = function ( image , repetition ) {
5413
- if ( image . complete || image . getContext || image . readyState >= 2 ) {
5434
+ if ( image . naturalWidth || image . getContext || image . readyState >= 2 ) {
5414
5435
var o = this . style = Graphics . _ctx . createPattern ( image , repetition || "" ) ;
5415
5436
o . props = { image : image , repetition : repetition , type : "bitmap" } ;
5416
5437
}
@@ -7331,7 +7352,7 @@ this.createjs = this.createjs||{};
7331
7352
*
7332
7353
* <h4>Example</h4>
7333
7354
*
7334
- * container.removeAlLChildren ();
7355
+ * container.removeAllChildren ();
7335
7356
*
7336
7357
* @method removeAllChildren
7337
7358
**/
@@ -8725,8 +8746,8 @@ this.createjs = this.createjs||{};
8725
8746
p . getBounds = function ( ) {
8726
8747
var rect = this . DisplayObject_getBounds ( ) ;
8727
8748
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 ) ) ;
8730
8751
return hasContent ? this . _rectangle . setValues ( 0 , 0 , o . width , o . height ) : null ;
8731
8752
} ;
8732
8753
@@ -12579,6 +12600,6 @@ this.createjs = this.createjs || {};
12579
12600
* @type String
12580
12601
* @static
12581
12602
**/
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
12583
12604
12584
12605
} ) ( ) ;
0 commit comments