libraries/EaselJS_docs/classes/DisplayObject.html (view raw)
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <link rel="stylesheet" href="../assets/css/yui-cssgrids-min.css">
6 <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
7 <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
8 <link rel="shortcut icon" type="image/x-icon" href="../assets/favicon.ico">
9 <script src="../assets/js/yui-source.js"></script>
10 <title>EaselJS v1.0.0 API Documentation : DisplayObject</title>
11</head>
12<body class="yui3-skin-sam">
13
14<div id="doc">
15 <div id="hd" class="yui3-g header">
16 <div class="yui3-u-3-4">
17
18 <h1><a href="http://www.createjs.com/easeljs"><img src="../assets/docs-icon-EaselJS.png" title="EaselJS"></a></h1>
19
20 </div>
21 <div class="version">
22 <em>API Documentation for: 1.0.0</em>
23 </div>
24 </div>
25 <div id="bd" class="yui3-g">
26
27 <div class="yui3-u-1-4">
28 <div id="docs-sidebar" class="sidebar apidocs">
29 <div id="api-list">
30 <h2 class="off-left">APIs</h2>
31 <div id="api-tabview" class="tabview">
32 <ul class="tabs">
33 <li><a href="#api-classes">Classes</a></li>
34 </ul>
35
36 <div id="api-tabview-filter">
37 <input type="search" id="api-filter" placeholder="Type to filter APIs">
38 </div>
39
40 <div id="api-tabview-panel">
41 <ul id="api-classes" class="apis classes">
42
43 <li><a href="../classes/AlphaMapFilter.html">AlphaMapFilter</a></li>
44
45 <li><a href="../classes/AlphaMaskFilter.html">AlphaMaskFilter</a></li>
46
47 <li><a href="../classes/Bitmap.html">Bitmap</a></li>
48
49 <li><a href="../classes/BitmapCache.html">BitmapCache</a></li>
50
51 <li><a href="../classes/BitmapText.html">BitmapText</a></li>
52
53 <li><a href="../classes/BlurFilter.html">BlurFilter</a></li>
54
55 <li><a href="../classes/ButtonHelper.html">ButtonHelper</a></li>
56
57 <li><a href="../classes/ColorFilter.html">ColorFilter</a></li>
58
59 <li><a href="../classes/ColorMatrix.html">ColorMatrix</a></li>
60
61 <li><a href="../classes/ColorMatrixFilter.html">ColorMatrixFilter</a></li>
62
63 <li><a href="../classes/Container.html">Container</a></li>
64
65 <li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
66
67 <li><a href="../classes/DisplayProps.html">DisplayProps</a></li>
68
69 <li><a href="../classes/DOMElement.html">DOMElement</a></li>
70
71 <li><a href="../classes/EaselJS.html">EaselJS</a></li>
72
73 <li><a href="../classes/Event.html">Event</a></li>
74
75 <li><a href="../classes/EventDispatcher.html">EventDispatcher</a></li>
76
77 <li><a href="../classes/Filter.html">Filter</a></li>
78
79 <li><a href="../classes/Graphics.html">Graphics</a></li>
80
81 <li><a href="../classes/Graphics.Arc.html">Graphics.Arc</a></li>
82
83 <li><a href="../classes/Graphics.ArcTo.html">Graphics.ArcTo</a></li>
84
85 <li><a href="../classes/Graphics.BeginPath.html">Graphics.BeginPath</a></li>
86
87 <li><a href="../classes/Graphics.BezierCurveTo.html">Graphics.BezierCurveTo</a></li>
88
89 <li><a href="../classes/Graphics.Circle.html">Graphics.Circle</a></li>
90
91 <li><a href="../classes/Graphics.ClosePath.html">Graphics.ClosePath</a></li>
92
93 <li><a href="../classes/Graphics.Ellipse.html">Graphics.Ellipse</a></li>
94
95 <li><a href="../classes/Graphics.Fill.html">Graphics.Fill</a></li>
96
97 <li><a href="../classes/Graphics.LineTo.html">Graphics.LineTo</a></li>
98
99 <li><a href="../classes/Graphics.MoveTo.html">Graphics.MoveTo</a></li>
100
101 <li><a href="../classes/Graphics.PolyStar.html">Graphics.PolyStar</a></li>
102
103 <li><a href="../classes/Graphics.QuadraticCurveTo.html">Graphics.QuadraticCurveTo</a></li>
104
105 <li><a href="../classes/Graphics.Rect.html">Graphics.Rect</a></li>
106
107 <li><a href="../classes/Graphics.RoundRect.html">Graphics.RoundRect</a></li>
108
109 <li><a href="../classes/Graphics.Stroke.html">Graphics.Stroke</a></li>
110
111 <li><a href="../classes/Graphics.StrokeDash.html">Graphics.StrokeDash</a></li>
112
113 <li><a href="../classes/Graphics.StrokeStyle.html">Graphics.StrokeStyle</a></li>
114
115 <li><a href="../classes/Matrix2D.html">Matrix2D</a></li>
116
117 <li><a href="../classes/MouseEvent.html">MouseEvent</a></li>
118
119 <li><a href="../classes/MovieClip.html">MovieClip</a></li>
120
121 <li><a href="../classes/MovieClipPlugin.html">MovieClipPlugin</a></li>
122
123 <li><a href="../classes/Point.html">Point</a></li>
124
125 <li><a href="../classes/Rectangle.html">Rectangle</a></li>
126
127 <li><a href="../classes/Shadow.html">Shadow</a></li>
128
129 <li><a href="../classes/Shape.html">Shape</a></li>
130
131 <li><a href="../classes/Sprite.html">Sprite</a></li>
132
133 <li><a href="../classes/SpriteSheet.html">SpriteSheet</a></li>
134
135 <li><a href="../classes/SpriteSheetBuilder.html">SpriteSheetBuilder</a></li>
136
137 <li><a href="../classes/SpriteSheetUtils.html">SpriteSheetUtils</a></li>
138
139 <li><a href="../classes/Stage.html">Stage</a></li>
140
141 <li><a href="../classes/StageGL.html">StageGL</a></li>
142
143 <li><a href="../classes/Text.html">Text</a></li>
144
145 <li><a href="../classes/Ticker.html">Ticker</a></li>
146
147 <li><a href="../classes/Touch.html">Touch</a></li>
148
149 <li><a href="../classes/UID.html">UID</a></li>
150
151 <li><a href="../classes/Utility Methods.html">Utility Methods</a></li>
152
153 <li><a href="../classes/VideoBuffer.html">VideoBuffer</a></li>
154
155 <li><a href="../classes/WebGLInspector.html">WebGLInspector</a></li>
156
157 </ul>
158
159 <ul id="api-modules" class="apis modules">
160
161 <li><a href="../modules/CreateJS.html">CreateJS</a></li>
162
163 <li><a href="../modules/EaselJS.html">EaselJS</a></li>
164
165 </ul>
166 </div>
167 </div>
168</div>
169
170 </div>
171 </div>
172 <div class="yui3-u-3-4">
173 <div id="api-options">
174 Show:
175 <label for="api-show-inherited">
176 <input type="checkbox" id="api-show-inherited" checked>
177 Inherited
178 </label>
179
180 <label for="api-show-protected">
181 <input type="checkbox" id="api-show-protected">
182 Protected
183 </label>
184
185 <label for="api-show-private">
186 <input type="checkbox" id="api-show-private">
187 Private
188 </label>
189 <label for="api-show-deprecated">
190 <input type="checkbox" id="api-show-deprecated">
191 Deprecated
192 </label>
193
194 </div>
195 <div class="apidocs">
196 <div id="docs-main">
197 <div class="content">
198 <h1>DisplayObject Class</h1>
199<div class="box meta">
200
201
202
203 <div class="extends">
204 Extends <a href="../classes/EventDispatcher.html" class="crosslink">EventDispatcher</a>
205 </div>
206
207
208
209 <div class="foundat">
210 Defined in: <a href="../files/easeljs_display_DisplayObject.js.html#l129"><code>DisplayObject:129</code></a>
211 </div>
212
213
214
215
216 Module: <a href="../modules/EaselJS.html">EaselJS</a>
217
218
219
220
221</div>
222
223
224
225<div class="box intro">
226 <p>DisplayObject is an abstract class that should not be constructed directly. Instead construct subclasses such as
227<a href="../classes/Container.html" class="crosslink">Container</a>, <a href="../classes/Bitmap.html" class="crosslink">Bitmap</a>, and <a href="../classes/Shape.html" class="crosslink">Shape</a>.
228DisplayObject is the base class for all display classes in the EaselJS library. It defines the core properties and
229methods that are shared between all display objects, such as transformation properties (x, y, scaleX, scaleY, etc),
230caching, and mouse handlers.</p>
231
232</div>
233
234
235 <div class="constructor">
236 <h2>Constructor</h2>
237 <div id="method_DisplayObject" class="method item">
238 <h3 class="name"><code>DisplayObject</code></h3>
239
240
241 <span class="paren">()</span>
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258 <div class="meta">
259
260
261
262 <p>
263
264 Defined in
265
266
267
268
269 <a href="../files/easeljs_display_DisplayObject.js.html#l129"><code>DisplayObject:129</code></a>
270
271 </p>
272
273
274
275
276
277 </div>
278
279 <div class="description">
280
281 </div>
282
283
284
285
286
287
288</div>
289
290 </div>
291
292
293<div id="classdocs" class="tabview">
294 <ul class="api-class-tabs">
295 <li class="api-class-tab index"><a href="#index">Index</a></li>
296
297
298 <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
299
300
301 <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
302
303
304
305 <li class="api-class-tab events"><a href="#events">Events</a></li>
306
307 </ul>
308
309 <div>
310 <div id="index" class="api-class-tabpanel index">
311 <h2 class="off-left">Item Index</h2>
312
313
314 <div class="index-section methods">
315 <h3>Methods</h3>
316
317 <ul class="index-list methods extends">
318
319 <li class="index-item method protected">
320 <a href="#method__applyShadow">_applyShadow</a>
321
322
323
324 </li>
325
326 <li class="index-item method protected">
327 <a href="#method__cloneProps">_cloneProps</a>
328
329
330
331 </li>
332
333 <li class="index-item method protected inherited">
334 <a href="#method__dispatchEvent">_dispatchEvent</a>
335
336
337
338 </li>
339
340 <li class="index-item method protected">
341 <a href="#method__getBounds">_getBounds</a>
342
343
344
345 </li>
346
347 <li class="index-item method protected">
348 <a href="#method__getStage">_getStage</a>
349
350
351
352 </li>
353
354 <li class="index-item method protected">
355 <a href="#method__isMouseOpaque">_isMouseOpaque</a>
356
357
358
359 </li>
360
361 <li class="index-item method protected">
362 <a href="#method__testHit">_testHit</a>
363
364
365
366 </li>
367
368 <li class="index-item method protected">
369 <a href="#method__tick">_tick</a>
370
371
372
373 </li>
374
375 <li class="index-item method protected">
376 <a href="#method__transformBounds">_transformBounds</a>
377
378
379
380 </li>
381
382 <li class="index-item method">
383 <a href="#method__updateState">_updateState</a>
384
385
386
387 </li>
388
389 <li class="index-item method inherited">
390 <a href="#method_addEventListener">addEventListener</a>
391
392
393
394 </li>
395
396 <li class="index-item method">
397 <a href="#method_cache">cache</a>
398
399
400
401 </li>
402
403 <li class="index-item method">
404 <a href="#method_clone">clone</a>
405
406
407
408 </li>
409
410 <li class="index-item method inherited">
411 <a href="#method_dispatchEvent">dispatchEvent</a>
412
413
414
415 </li>
416
417 <li class="index-item method">
418 <a href="#method_draw">draw</a>
419
420
421
422 </li>
423
424 <li class="index-item method">
425 <a href="#method_getBounds">getBounds</a>
426
427
428
429 </li>
430
431 <li class="index-item method">
432 <a href="#method_getCacheDataURL">getCacheDataURL</a>
433
434
435
436 </li>
437
438 <li class="index-item method">
439 <a href="#method_getConcatenatedDisplayProps">getConcatenatedDisplayProps</a>
440
441
442
443 </li>
444
445 <li class="index-item method">
446 <a href="#method_getConcatenatedMatrix">getConcatenatedMatrix</a>
447
448
449
450 </li>
451
452 <li class="index-item method">
453 <a href="#method_getMatrix">getMatrix</a>
454
455
456
457 </li>
458
459 <li class="index-item method">
460 <a href="#method_getTransformedBounds">getTransformedBounds</a>
461
462
463
464 </li>
465
466 <li class="index-item method">
467 <a href="#method_globalToLocal">globalToLocal</a>
468
469
470
471 </li>
472
473 <li class="index-item method inherited">
474 <a href="#method_hasEventListener">hasEventListener</a>
475
476
477
478 </li>
479
480 <li class="index-item method">
481 <a href="#method_hitTest">hitTest</a>
482
483
484
485 </li>
486
487 <li class="index-item method">
488 <a href="#method_isVisible">isVisible</a>
489
490
491
492 </li>
493
494 <li class="index-item method">
495 <a href="#method_localToGlobal">localToGlobal</a>
496
497
498
499 </li>
500
501 <li class="index-item method">
502 <a href="#method_localToLocal">localToLocal</a>
503
504
505
506 </li>
507
508 <li class="index-item method inherited">
509 <a href="#method_off">off</a>
510
511
512
513 </li>
514
515 <li class="index-item method inherited">
516 <a href="#method_on">on</a>
517
518
519
520 </li>
521
522 <li class="index-item method inherited">
523 <a href="#method_removeAllEventListeners">removeAllEventListeners</a>
524
525
526
527 </li>
528
529 <li class="index-item method inherited">
530 <a href="#method_removeEventListener">removeEventListener</a>
531
532
533
534 </li>
535
536 <li class="index-item method">
537 <a href="#method_set">set</a>
538
539
540
541 </li>
542
543 <li class="index-item method">
544 <a href="#method_setBounds">setBounds</a>
545
546
547
548 </li>
549
550 <li class="index-item method">
551 <a href="#method_setTransform">setTransform</a>
552
553
554
555 </li>
556
557 <li class="index-item method inherited">
558 <a href="#method_toString">toString</a>
559
560
561
562 </li>
563
564 <li class="index-item method">
565 <a href="#method_uncache">uncache</a>
566
567
568
569 </li>
570
571 <li class="index-item method">
572 <a href="#method_updateCache">updateCache</a>
573
574
575
576 </li>
577
578 <li class="index-item method">
579 <a href="#method_updateContext">updateContext</a>
580
581
582
583 </li>
584
585 <li class="index-item method inherited">
586 <a href="#method_willTrigger">willTrigger</a>
587
588
589
590 </li>
591
592 </ul>
593 </div>
594
595
596
597 <div class="index-section properties">
598 <h3>Properties</h3>
599
600 <ul class="index-list properties extends">
601
602 <li class="index-item property protected">
603 <a href="#property__bounds">_bounds</a>
604
605
606
607 </li>
608
609 <li class="index-item property protected deprecated">
610 <a href="#property__cacheDataURL">_cacheDataURL</a>
611
612
613
614 <span class="flag deprecated">deprecated</span>
615
616 </li>
617
618 <li class="index-item property protected deprecated">
619 <a href="#property__cacheDataURLID">_cacheDataURLID</a>
620
621
622
623 <span class="flag deprecated">deprecated</span>
624
625 </li>
626
627 <li class="index-item property protected deprecated">
628 <a href="#property__cacheScale">_cacheScale</a>
629
630
631
632 <span class="flag deprecated">deprecated</span>
633
634 </li>
635
636 <li class="index-item property protected inherited">
637 <a href="#property__captureListeners">_captureListeners</a>
638
639
640
641 </li>
642
643 <li class="index-item property protected">
644 <a href="#property__hitTestCanvas">_hitTestCanvas</a>
645
646
647 <span class="flag static">static</span>
648
649
650 </li>
651
652 <li class="index-item property protected">
653 <a href="#property__hitTestContext">_hitTestContext</a>
654
655
656 <span class="flag static">static</span>
657
658
659 </li>
660
661 <li class="index-item property protected inherited">
662 <a href="#property__listeners">_listeners</a>
663
664
665
666 </li>
667
668 <li class="index-item property protected">
669 <a href="#property__MOUSE_EVENTS">_MOUSE_EVENTS</a>
670
671
672 <span class="flag static">static</span>
673
674
675 </li>
676
677 <li class="index-item property protected">
678 <a href="#property__props">_props</a>
679
680
681
682 </li>
683
684 <li class="index-item property protected">
685 <a href="#property__rectangle">_rectangle</a>
686
687
688
689 </li>
690
691 <li class="index-item property protected">
692 <a href="#property__snapToPixelEnabled">_snapToPixelEnabled</a>
693
694
695 <span class="flag static">static</span>
696
697
698 </li>
699
700 <li class="index-item property protected">
701 <a href="#property__StageGL_BITMAP">_StageGL_BITMAP</a>
702
703
704 <span class="flag static">static</span>
705
706
707 </li>
708
709 <li class="index-item property protected">
710 <a href="#property__StageGL_NONE">_StageGL_NONE</a>
711
712
713 <span class="flag static">static</span>
714
715
716 </li>
717
718 <li class="index-item property protected">
719 <a href="#property__StageGL_SPRITE">_StageGL_SPRITE</a>
720
721
722 <span class="flag static">static</span>
723
724
725 </li>
726
727 <li class="index-item property protected">
728 <a href="#property__webGLRenderStyle">_webGLRenderStyle</a>
729
730
731
732 </li>
733
734 <li class="index-item property">
735 <a href="#property_alpha">alpha</a>
736
737
738
739 </li>
740
741 <li class="index-item property">
742 <a href="#property_bitmapCache">bitmapCache</a>
743
744
745
746 </li>
747
748 <li class="index-item property">
749 <a href="#property_cacheCanvas">cacheCanvas</a>
750
751
752
753 </li>
754
755 <li class="index-item property deprecated">
756 <a href="#property_cacheID">cacheID</a>
757
758
759
760 <span class="flag deprecated">deprecated</span>
761
762 </li>
763
764 <li class="index-item property">
765 <a href="#property_compositeOperation">compositeOperation</a>
766
767
768
769 </li>
770
771 <li class="index-item property">
772 <a href="#property_cursor">cursor</a>
773
774
775
776 </li>
777
778 <li class="index-item property">
779 <a href="#property_filters">filters</a>
780
781
782
783 </li>
784
785 <li class="index-item property">
786 <a href="#property_hitArea">hitArea</a>
787
788
789
790 </li>
791
792 <li class="index-item property">
793 <a href="#property_id">id</a>
794
795
796
797 </li>
798
799 <li class="index-item property">
800 <a href="#property_mask">mask</a>
801
802
803
804 </li>
805
806 <li class="index-item property">
807 <a href="#property_mouseEnabled">mouseEnabled</a>
808
809
810
811 </li>
812
813 <li class="index-item property">
814 <a href="#property_name">name</a>
815
816
817
818 </li>
819
820 <li class="index-item property">
821 <a href="#property_parent">parent</a>
822
823
824
825 </li>
826
827 <li class="index-item property">
828 <a href="#property_regX">regX</a>
829
830
831
832 </li>
833
834 <li class="index-item property">
835 <a href="#property_regY">regY</a>
836
837
838
839 </li>
840
841 <li class="index-item property">
842 <a href="#property_rotation">rotation</a>
843
844
845
846 </li>
847
848 <li class="index-item property">
849 <a href="#property_scaleX">scaleX</a>
850
851
852
853 </li>
854
855 <li class="index-item property">
856 <a href="#property_scaleX">scaleX</a>
857
858
859
860 </li>
861
862 <li class="index-item property">
863 <a href="#property_scaleY">scaleY</a>
864
865
866
867 </li>
868
869 <li class="index-item property">
870 <a href="#property_shadow">shadow</a>
871
872
873
874 </li>
875
876 <li class="index-item property">
877 <a href="#property_skewX">skewX</a>
878
879
880
881 </li>
882
883 <li class="index-item property">
884 <a href="#property_skewY">skewY</a>
885
886
887
888 </li>
889
890 <li class="index-item property">
891 <a href="#property_snapToPixel">snapToPixel</a>
892
893
894
895 </li>
896
897 <li class="index-item property">
898 <a href="#property_stage">stage</a>
899
900
901
902 </li>
903
904 <li class="index-item property">
905 <a href="#property_suppressCrossDomainErrors">suppressCrossDomainErrors</a>
906
907
908 <span class="flag static">static</span>
909
910
911 </li>
912
913 <li class="index-item property">
914 <a href="#property_tickEnabled">tickEnabled</a>
915
916
917
918 </li>
919
920 <li class="index-item property">
921 <a href="#property_transformMatrix">transformMatrix</a>
922
923
924
925 </li>
926
927 <li class="index-item property">
928 <a href="#property_visible">visible</a>
929
930
931
932 </li>
933
934 <li class="index-item property">
935 <a href="#property_x">x</a>
936
937
938
939 </li>
940
941 <li class="index-item property">
942 <a href="#property_y">y</a>
943
944
945
946 </li>
947
948 </ul>
949 </div>
950
951
952
953
954
955 <div class="index-section events">
956 <h3>Events</h3>
957
958 <ul class="index-list events extends">
959
960 <li class="index-item event">
961 <a href="#event_added">added</a>
962
963
964
965 </li>
966
967 <li class="index-item event">
968 <a href="#event_click">click</a>
969
970
971
972 </li>
973
974 <li class="index-item event">
975 <a href="#event_dblclick">dblclick</a>
976
977
978
979 </li>
980
981 <li class="index-item event">
982 <a href="#event_mousedown">mousedown</a>
983
984
985
986 </li>
987
988 <li class="index-item event">
989 <a href="#event_mouseout">mouseout</a>
990
991
992
993 </li>
994
995 <li class="index-item event">
996 <a href="#event_mouseover">mouseover</a>
997
998
999
1000 </li>
1001
1002 <li class="index-item event">
1003 <a href="#event_pressmove">pressmove</a>
1004
1005
1006
1007 </li>
1008
1009 <li class="index-item event">
1010 <a href="#event_pressup">pressup</a>
1011
1012
1013
1014 </li>
1015
1016 <li class="index-item event">
1017 <a href="#event_removed">removed</a>
1018
1019
1020
1021 </li>
1022
1023 <li class="index-item event">
1024 <a href="#event_rollout">rollout</a>
1025
1026
1027
1028 </li>
1029
1030 <li class="index-item event">
1031 <a href="#event_rollover">rollover</a>
1032
1033
1034
1035 </li>
1036
1037 <li class="index-item event">
1038 <a href="#event_tick">tick</a>
1039
1040
1041
1042 </li>
1043
1044 </ul>
1045 </div>
1046
1047 </div>
1048
1049
1050 <div id="methods" class="api-class-tabpanel">
1051 <h2 class="off-left">Methods</h2>
1052
1053
1054 <div id="method__applyShadow" class="method item protected">
1055 <h3 class="name"><code>_applyShadow</code></h3>
1056
1057
1058 <div class="args">
1059 <span class="paren">(</span><ul class="args-list inline commas">
1060
1061 <li class="arg">
1062
1063 <code>ctx</code>
1064
1065 </li>
1066
1067 <li class="arg">
1068
1069 <code>shadow</code>
1070
1071 </li>
1072
1073 </ul><span class="paren">)</span>
1074 </div>
1075
1076
1077
1078
1079
1080
1081
1082 <span class="flag protected">protected</span>
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093 <div class="meta">
1094
1095
1096
1097 <p>
1098
1099 Defined in
1100
1101
1102
1103
1104 <a href="../files/easeljs_display_DisplayObject.js.html#l1261"><code>_applyShadow:1261</code></a>
1105
1106 </p>
1107
1108
1109
1110
1111
1112 </div>
1113
1114 <div class="description">
1115
1116 </div>
1117
1118
1119 <div class="params">
1120 <h4>Parameters:</h4>
1121
1122 <ul class="params-list">
1123
1124 <li class="param">
1125
1126 <code class="param-name">ctx</code>
1127 <span class="type">CanvasRenderingContext2D</span>
1128
1129
1130
1131
1132 <div class="param-description">
1133
1134 </div>
1135
1136
1137 </li>
1138
1139 <li class="param">
1140
1141 <code class="param-name">shadow</code>
1142 <span class="type"><a href="../classes/Shadow.html" class="crosslink">Shadow</a></span>
1143
1144
1145
1146
1147 <div class="param-description">
1148
1149 </div>
1150
1151
1152 </li>
1153
1154 </ul>
1155 </div>
1156
1157
1158
1159
1160
1161</div>
1162
1163
1164 <div id="method__cloneProps" class="method item protected">
1165 <h3 class="name"><code>_cloneProps</code></h3>
1166
1167
1168 <div class="args">
1169 <span class="paren">(</span><ul class="args-list inline commas">
1170
1171 <li class="arg">
1172
1173 <code>o</code>
1174
1175 </li>
1176
1177 </ul><span class="paren">)</span>
1178 </div>
1179
1180
1181
1182 <span class="returns-inline">
1183 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
1184 </span>
1185
1186
1187
1188
1189
1190 <span class="flag protected">protected</span>
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201 <div class="meta">
1202
1203
1204
1205 <p>
1206
1207 Defined in
1208
1209
1210
1211
1212 <a href="../files/easeljs_display_DisplayObject.js.html#l1228"><code>_cloneProps:1228</code></a>
1213
1214 </p>
1215
1216
1217
1218
1219
1220 </div>
1221
1222 <div class="description">
1223
1224 </div>
1225
1226
1227 <div class="params">
1228 <h4>Parameters:</h4>
1229
1230 <ul class="params-list">
1231
1232 <li class="param">
1233
1234 <code class="param-name">o</code>
1235 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
1236
1237
1238
1239
1240 <div class="param-description">
1241 <p>The DisplayObject instance which will have properties from the current DisplayObject
1242instance copied into.</p>
1243
1244 </div>
1245
1246
1247 </li>
1248
1249 </ul>
1250 </div>
1251
1252
1253
1254 <div class="returns">
1255 <h4>Returns:</h4>
1256
1257 <div class="returns-description">
1258
1259
1260 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>:
1261
1262 <p>o</p>
1263
1264
1265 </div>
1266 </div>
1267
1268
1269
1270</div>
1271
1272
1273 <div id="method__dispatchEvent" class="method item protected inherited">
1274 <h3 class="name"><code>_dispatchEvent</code></h3>
1275
1276
1277 <div class="args">
1278 <span class="paren">(</span><ul class="args-list inline commas">
1279
1280 <li class="arg">
1281
1282 <code>eventObj</code>
1283
1284 </li>
1285
1286 <li class="arg">
1287
1288 <code>eventPhase</code>
1289
1290 </li>
1291
1292 </ul><span class="paren">)</span>
1293 </div>
1294
1295
1296
1297
1298
1299
1300
1301 <span class="flag protected">protected</span>
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312 <div class="meta">
1313
1314
1315 <p>Inherited from
1316 <a href="../classes/EventDispatcher.html#method__dispatchEvent">EventDispatcher</a>:
1317
1318
1319
1320 <a href="../files/createjs_events_EventDispatcher.js.html#l380"><code>_dispatchEvent:380</code></a>
1321
1322 </p>
1323
1324
1325
1326
1327
1328 </div>
1329
1330 <div class="description">
1331
1332 </div>
1333
1334
1335 <div class="params">
1336 <h4>Parameters:</h4>
1337
1338 <ul class="params-list">
1339
1340 <li class="param">
1341
1342 <code class="param-name">eventObj</code>
1343 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a> | <a href="../classes/Event.html" class="crosslink">Event</a></span>
1344
1345
1346
1347
1348 <div class="param-description">
1349
1350 </div>
1351
1352
1353 </li>
1354
1355 <li class="param">
1356
1357 <code class="param-name">eventPhase</code>
1358 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
1359
1360
1361
1362
1363 <div class="param-description">
1364
1365 </div>
1366
1367
1368 </li>
1369
1370 </ul>
1371 </div>
1372
1373
1374
1375
1376
1377</div>
1378
1379
1380 <div id="method__getBounds" class="method item protected">
1381 <h3 class="name"><code>_getBounds</code></h3>
1382
1383
1384 <div class="args">
1385 <span class="paren">(</span><ul class="args-list inline commas">
1386
1387 <li class="arg">
1388
1389 <code>matrix</code>
1390
1391 </li>
1392
1393 <li class="arg">
1394
1395 <code>ignoreTransform</code>
1396
1397 </li>
1398
1399 </ul><span class="paren">)</span>
1400 </div>
1401
1402
1403
1404 <span class="returns-inline">
1405 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1406 </span>
1407
1408
1409
1410
1411
1412 <span class="flag protected">protected</span>
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423 <div class="meta">
1424
1425
1426
1427 <p>
1428
1429 Defined in
1430
1431
1432
1433
1434 <a href="../files/easeljs_display_DisplayObject.js.html#l1308"><code>_getBounds:1308</code></a>
1435
1436 </p>
1437
1438
1439
1440
1441
1442 </div>
1443
1444 <div class="description">
1445
1446 </div>
1447
1448
1449 <div class="params">
1450 <h4>Parameters:</h4>
1451
1452 <ul class="params-list">
1453
1454 <li class="param">
1455
1456 <code class="param-name">matrix</code>
1457 <span class="type"><a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a></span>
1458
1459
1460
1461
1462 <div class="param-description">
1463
1464 </div>
1465
1466
1467 </li>
1468
1469 <li class="param">
1470
1471 <code class="param-name">ignoreTransform</code>
1472 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
1473
1474
1475
1476
1477 <div class="param-description">
1478 <p>If true, does not apply this object's transform.</p>
1479
1480 </div>
1481
1482
1483 </li>
1484
1485 </ul>
1486 </div>
1487
1488
1489
1490 <div class="returns">
1491 <h4>Returns:</h4>
1492
1493 <div class="returns-description">
1494
1495
1496 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
1497
1498
1499 </div>
1500 </div>
1501
1502
1503
1504</div>
1505
1506
1507 <div id="method__getStage" class="method item protected">
1508 <h3 class="name"><code>_getStage</code></h3>
1509
1510
1511 <span class="paren">()</span>
1512
1513
1514
1515 <span class="returns-inline">
1516 <span class="type"><a href="../classes/Stage.html" class="crosslink">Stage</a></span>
1517 </span>
1518
1519
1520
1521
1522
1523 <span class="flag protected">protected</span>
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534 <div class="meta">
1535
1536
1537
1538 <p>
1539
1540 Defined in
1541
1542
1543
1544
1545 <a href="../files/easeljs_display_DisplayObject.js.html#l672"><code>_getStage:672</code></a>
1546
1547 </p>
1548
1549
1550
1551
1552
1553 </div>
1554
1555 <div class="description">
1556 <p>Use the <a href="../classes/DisplayObject.html#property_stage" class="crosslink">stage</a> property instead.</p>
1557
1558 </div>
1559
1560
1561
1562
1563 <div class="returns">
1564 <h4>Returns:</h4>
1565
1566 <div class="returns-description">
1567
1568
1569 <span class="type"><a href="../classes/Stage.html" class="crosslink">Stage</a></span>:
1570
1571
1572 </div>
1573 </div>
1574
1575
1576
1577</div>
1578
1579
1580 <div id="method__isMouseOpaque" class="method item protected">
1581 <h3 class="name"><code>_isMouseOpaque</code></h3>
1582
1583
1584 <span class="paren">()</span>
1585
1586
1587
1588 <span class="returns-inline">
1589 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
1590 </span>
1591
1592
1593
1594
1595
1596 <span class="flag protected">protected</span>
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607 <div class="meta">
1608
1609
1610
1611 <p>
1612
1613 Defined in
1614
1615
1616
1617
1618 <a href="../files/easeljs_display_DisplayObject.js.html#l1352"><code>_isMouseOpaque:1352</code></a>
1619
1620 </p>
1621
1622
1623
1624
1625
1626 </div>
1627
1628 <div class="description">
1629 <p>Indicates whether the display object has any mouse event listeners or a cursor.</p>
1630
1631 </div>
1632
1633
1634
1635
1636 <div class="returns">
1637 <h4>Returns:</h4>
1638
1639 <div class="returns-description">
1640
1641
1642 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
1643
1644
1645 </div>
1646 </div>
1647
1648
1649
1650</div>
1651
1652
1653 <div id="method__testHit" class="method item protected">
1654 <h3 class="name"><code>_testHit</code></h3>
1655
1656
1657 <div class="args">
1658 <span class="paren">(</span><ul class="args-list inline commas">
1659
1660 <li class="arg">
1661
1662 <code>ctx</code>
1663
1664 </li>
1665
1666 </ul><span class="paren">)</span>
1667 </div>
1668
1669
1670
1671 <span class="returns-inline">
1672 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
1673 </span>
1674
1675
1676
1677
1678
1679 <span class="flag protected">protected</span>
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690 <div class="meta">
1691
1692
1693
1694 <p>
1695
1696 Defined in
1697
1698
1699
1700
1701 <a href="../files/easeljs_display_DisplayObject.js.html#l1291"><code>_testHit:1291</code></a>
1702
1703 </p>
1704
1705
1706
1707
1708
1709 </div>
1710
1711 <div class="description">
1712
1713 </div>
1714
1715
1716 <div class="params">
1717 <h4>Parameters:</h4>
1718
1719 <ul class="params-list">
1720
1721 <li class="param">
1722
1723 <code class="param-name">ctx</code>
1724 <span class="type">CanvasRenderingContext2D</span>
1725
1726
1727
1728
1729 <div class="param-description">
1730
1731 </div>
1732
1733
1734 </li>
1735
1736 </ul>
1737 </div>
1738
1739
1740
1741 <div class="returns">
1742 <h4>Returns:</h4>
1743
1744 <div class="returns-description">
1745
1746
1747 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
1748
1749
1750 </div>
1751 </div>
1752
1753
1754
1755</div>
1756
1757
1758 <div id="method__tick" class="method item protected">
1759 <h3 class="name"><code>_tick</code></h3>
1760
1761
1762 <div class="args">
1763 <span class="paren">(</span><ul class="args-list inline commas">
1764
1765 <li class="arg">
1766
1767 <code>evtObj</code>
1768
1769 </li>
1770
1771 </ul><span class="paren">)</span>
1772 </div>
1773
1774
1775
1776
1777
1778
1779
1780 <span class="flag protected">protected</span>
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791 <div class="meta">
1792
1793
1794
1795 <p>
1796
1797 Defined in
1798
1799
1800
1801
1802 <a href="../files/easeljs_display_DisplayObject.js.html#l1275"><code>_tick:1275</code></a>
1803
1804 </p>
1805
1806
1807
1808
1809
1810 </div>
1811
1812 <div class="description">
1813
1814 </div>
1815
1816
1817 <div class="params">
1818 <h4>Parameters:</h4>
1819
1820 <ul class="params-list">
1821
1822 <li class="param">
1823
1824 <code class="param-name">evtObj</code>
1825 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
1826
1827
1828
1829
1830 <div class="param-description">
1831 <p>An event object that will be dispatched to all tick listeners. This object is reused between dispatchers to reduce construction & GC costs.</p>
1832
1833 </div>
1834
1835
1836 </li>
1837
1838 </ul>
1839 </div>
1840
1841
1842
1843
1844
1845</div>
1846
1847
1848 <div id="method__transformBounds" class="method item protected">
1849 <h3 class="name"><code>_transformBounds</code></h3>
1850
1851
1852 <div class="args">
1853 <span class="paren">(</span><ul class="args-list inline commas">
1854
1855 <li class="arg">
1856
1857 <code>bounds</code>
1858
1859 </li>
1860
1861 <li class="arg">
1862
1863 <code>matrix</code>
1864
1865 </li>
1866
1867 <li class="arg">
1868
1869 <code>ignoreTransform</code>
1870
1871 </li>
1872
1873 </ul><span class="paren">)</span>
1874 </div>
1875
1876
1877
1878 <span class="returns-inline">
1879 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1880 </span>
1881
1882
1883
1884
1885
1886 <span class="flag protected">protected</span>
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897 <div class="meta">
1898
1899
1900
1901 <p>
1902
1903 Defined in
1904
1905
1906
1907
1908 <a href="../files/easeljs_display_DisplayObject.js.html#l1319"><code>_transformBounds:1319</code></a>
1909
1910 </p>
1911
1912
1913
1914
1915
1916 </div>
1917
1918 <div class="description">
1919
1920 </div>
1921
1922
1923 <div class="params">
1924 <h4>Parameters:</h4>
1925
1926 <ul class="params-list">
1927
1928 <li class="param">
1929
1930 <code class="param-name">bounds</code>
1931 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1932
1933
1934
1935
1936 <div class="param-description">
1937
1938 </div>
1939
1940
1941 </li>
1942
1943 <li class="param">
1944
1945 <code class="param-name">matrix</code>
1946 <span class="type"><a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a></span>
1947
1948
1949
1950
1951 <div class="param-description">
1952
1953 </div>
1954
1955
1956 </li>
1957
1958 <li class="param">
1959
1960 <code class="param-name">ignoreTransform</code>
1961 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
1962
1963
1964
1965
1966 <div class="param-description">
1967
1968 </div>
1969
1970
1971 </li>
1972
1973 </ul>
1974 </div>
1975
1976
1977
1978 <div class="returns">
1979 <h4>Returns:</h4>
1980
1981 <div class="returns-description">
1982
1983
1984 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
1985
1986
1987 </div>
1988 </div>
1989
1990
1991
1992</div>
1993
1994
1995 <div id="method__updateState" class="method item">
1996 <h3 class="name"><code>_updateState</code></h3>
1997
1998
1999 <span class="paren">()</span>
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016 <div class="meta">
2017
2018
2019
2020 <p>
2021
2022 Defined in
2023
2024
2025
2026
2027 <a href="../files/easeljs_display_DisplayObject.js.html#l1214"><code>_updateState:1214</code></a>
2028
2029 </p>
2030
2031
2032
2033
2034
2035 </div>
2036
2037 <div class="description">
2038 <p>Called before the object gets drawn and is a chance to ensure the display state of the object is correct.
2039Mostly used by <a href="../classes/MovieClip.html" class="crosslink">MovieClip</a> and <a href="../classes/BitmapText.html" class="crosslink">BitmapText</a> to
2040correct their internal state and children prior to being drawn.</p>
2041<p>Is manually called via draw in a <a href="../classes/Stage.html" class="crosslink">Stage</a> but is automatically called when
2042present in a <a href="../classes/StageGL.html" class="crosslink">StageGL</a> instance.</p>
2043
2044 </div>
2045
2046
2047
2048
2049
2050
2051</div>
2052
2053
2054 <div id="method_addEventListener" class="method item inherited">
2055 <h3 class="name"><code>addEventListener</code></h3>
2056
2057
2058 <div class="args">
2059 <span class="paren">(</span><ul class="args-list inline commas">
2060
2061 <li class="arg">
2062
2063 <code>type</code>
2064
2065 </li>
2066
2067 <li class="arg">
2068
2069 <code>listener</code>
2070
2071 </li>
2072
2073 <li class="arg">
2074
2075 <code class="optional">[useCapture]</code>
2076
2077 </li>
2078
2079 </ul><span class="paren">)</span>
2080 </div>
2081
2082
2083
2084 <span class="returns-inline">
2085 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
2086 </span>
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101 <div class="meta">
2102
2103
2104 <p>Inherited from
2105 <a href="../classes/EventDispatcher.html#method_addEventListener">EventDispatcher</a>:
2106
2107
2108
2109 <a href="../files/createjs_events_EventDispatcher.js.html#l140"><code>addEventListener:140</code></a>
2110
2111 </p>
2112
2113
2114
2115
2116
2117 </div>
2118
2119 <div class="description">
2120 <p><p>Adds the specified event listener. Note that adding multiple listeners to the same function will result in
2121multiple callbacks getting fired.</p></p>
2122<h4>Example</h4>
2123
2124<pre class="code prettyprint"><code> displayObject.addEventListener("click", handleClick);
2125 function handleClick(event) {
2126 // Click happened.
2127 }</code></pre>
2128
2129 </div>
2130
2131
2132 <div class="params">
2133 <h4>Parameters:</h4>
2134
2135 <ul class="params-list">
2136
2137 <li class="param">
2138
2139 <code class="param-name">type</code>
2140 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
2141
2142
2143
2144
2145 <div class="param-description">
2146 <p>The string type of the event.</p>
2147
2148 </div>
2149
2150
2151 </li>
2152
2153 <li class="param">
2154
2155 <code class="param-name">listener</code>
2156 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
2157
2158
2159
2160
2161 <div class="param-description">
2162 <p>An object with a handleEvent method, or a function that will be called when
2163the event is dispatched.</p>
2164
2165 </div>
2166
2167
2168 </li>
2169
2170 <li class="param">
2171
2172 <code class="param-name optional">[useCapture]</code>
2173 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
2174 <span class="flag optional" title="This parameter is optional.">optional</span>
2175
2176
2177
2178
2179 <div class="param-description">
2180 <p>For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.</p>
2181
2182 </div>
2183
2184
2185 </li>
2186
2187 </ul>
2188 </div>
2189
2190
2191
2192 <div class="returns">
2193 <h4>Returns:</h4>
2194
2195 <div class="returns-description">
2196
2197
2198 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>:
2199
2200 <p>Returns the listener for chaining or assignment.</p>
2201
2202
2203 </div>
2204 </div>
2205
2206
2207
2208</div>
2209
2210
2211 <div id="method_cache" class="method item">
2212 <h3 class="name"><code>cache</code></h3>
2213
2214
2215 <div class="args">
2216 <span class="paren">(</span><ul class="args-list inline commas">
2217
2218 <li class="arg">
2219
2220 <code>x</code>
2221
2222 </li>
2223
2224 <li class="arg">
2225
2226 <code>y</code>
2227
2228 </li>
2229
2230 <li class="arg">
2231
2232 <code>width</code>
2233
2234 </li>
2235
2236 <li class="arg">
2237
2238 <code>height</code>
2239
2240 </li>
2241
2242 <li class="arg">
2243
2244 <code class="optional">[scale=1]</code>
2245
2246 </li>
2247
2248 <li class="arg">
2249
2250 <code class="optional">[options=undefined]</code>
2251
2252 </li>
2253
2254 </ul><span class="paren">)</span>
2255 </div>
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272 <div class="meta">
2273
2274
2275
2276 <p>
2277
2278 Defined in
2279
2280
2281
2282
2283 <a href="../files/easeljs_display_DisplayObject.js.html#l792"><code>cache:792</code></a>
2284
2285 </p>
2286
2287
2288
2289
2290
2291 </div>
2292
2293 <div class="description">
2294 <p>Draws the display object into a new element, which is then used for subsequent draws. Intended for complex content
2295that does not change frequently (ex. a Container with many children that do not move, or a complex vector Shape),
2296this can provide for much faster rendering because the content does not need to be re-rendered each tick. The
2297cached display object can be moved, rotated, faded, etc freely, however if its content changes, you must manually
2298update the cache by calling <code>updateCache()</code> again. You must specify the cached area via the x, y, w,
2299and h parameters. This defines the rectangle that will be rendered and cached using this display object's coordinates.</p>
2300<p><h4>Example</h4>
2301For example if you defined a Shape that drew a circle at 0, 0 with a radius of 25:</p>
2302<pre class="code prettyprint"><code> var shape = new createjs.Shape();
2303 shape.graphics.beginFill("#ff0000").drawCircle(0, 0, 25);
2304 shape.cache(-25, -25, 50, 50);</code></pre>
2305<p>Note that filters need to be defined <em>before</em> the cache is applied or you will have to call updateCache after
2306application. Check out the <a href="../classes/Filter.html" class="crosslink">Filter</a> class for more information. Some filters
2307(ex. BlurFilter) may not work as expected in conjunction with the scale param.</p>
2308<p>Usually, the resulting cacheCanvas will have the dimensions width <em> scale, height </em> scale, however some filters (ex. BlurFilter)
2309will add padding to the canvas dimensions.</p>
2310<p>In previous versions caching was handled on DisplayObject but has since been moved to <a href="../classes/BitmapCache.html" class="crosslink">BitmapCache</a>.
2311This allows for easier interaction and alternate cache methods like WebGL with <a href="../classes/StageGL.html" class="crosslink">StageGL</a>.
2312For more information on the options object, see the BitmapCache BitmapCache/define.</p>
2313
2314 </div>
2315
2316
2317 <div class="params">
2318 <h4>Parameters:</h4>
2319
2320 <ul class="params-list">
2321
2322 <li class="param">
2323
2324 <code class="param-name">x</code>
2325 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
2326
2327
2328
2329
2330 <div class="param-description">
2331 <p>The x coordinate origin for the cache region.</p>
2332
2333 </div>
2334
2335
2336 </li>
2337
2338 <li class="param">
2339
2340 <code class="param-name">y</code>
2341 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
2342
2343
2344
2345
2346 <div class="param-description">
2347 <p>The y coordinate origin for the cache region.</p>
2348
2349 </div>
2350
2351
2352 </li>
2353
2354 <li class="param">
2355
2356 <code class="param-name">width</code>
2357 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
2358
2359
2360
2361
2362 <div class="param-description">
2363 <p>The width of the cache region.</p>
2364
2365 </div>
2366
2367
2368 </li>
2369
2370 <li class="param">
2371
2372 <code class="param-name">height</code>
2373 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
2374
2375
2376
2377
2378 <div class="param-description">
2379 <p>The height of the cache region.</p>
2380
2381 </div>
2382
2383
2384 </li>
2385
2386 <li class="param">
2387
2388 <code class="param-name optional">[scale=1]</code>
2389 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
2390 <span class="flag optional" title="This parameter is optional.">optional</span>
2391
2392
2393
2394
2395 <div class="param-description">
2396 <p>The scale at which the cache will be created. For example, if you cache a vector shape using
2397 myShape.cache(0,0,100,100,2) then the resulting cacheCanvas will be 200x200 px. This lets you scale and rotate
2398 cached elements with greater fidelity. Default is 1.</p>
2399
2400 </div>
2401
2402
2403 </li>
2404
2405 <li class="param">
2406
2407 <code class="param-name optional">[options=undefined]</code>
2408 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
2409 <span class="flag optional" title="This parameter is optional.">optional</span>
2410
2411
2412
2413
2414 <div class="param-description">
2415 <p>Specify additional parameters for the cache logic</p>
2416
2417 </div>
2418
2419
2420 </li>
2421
2422 </ul>
2423 </div>
2424
2425
2426
2427
2428
2429</div>
2430
2431
2432 <div id="method_clone" class="method item">
2433 <h3 class="name"><code>clone</code></h3>
2434
2435
2436 <span class="paren">()</span>
2437
2438
2439
2440 <span class="returns-inline">
2441 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
2442 </span>
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457 <div class="meta">
2458
2459
2460
2461 <p>
2462
2463 Defined in
2464
2465
2466
2467
2468 <a href="../files/easeljs_display_DisplayObject.js.html#l1192"><code>clone:1192</code></a>
2469
2470 </p>
2471
2472
2473
2474
2475
2476 </div>
2477
2478 <div class="description">
2479 <p>Returns a clone of this DisplayObject. Some properties that are specific to this instance's current context are
2480reverted to their defaults (for example .parent). Caches are not maintained across clones, and some elements
2481are copied by reference (masks, individual filter instances, hit area)</p>
2482
2483 </div>
2484
2485
2486
2487
2488 <div class="returns">
2489 <h4>Returns:</h4>
2490
2491 <div class="returns-description">
2492
2493
2494 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>:
2495
2496 <p>A clone of the current DisplayObject instance.</p>
2497
2498
2499 </div>
2500 </div>
2501
2502
2503
2504</div>
2505
2506
2507 <div id="method_dispatchEvent" class="method item inherited">
2508 <h3 class="name"><code>dispatchEvent</code></h3>
2509
2510
2511 <div class="args">
2512 <span class="paren">(</span><ul class="args-list inline commas">
2513
2514 <li class="arg">
2515
2516 <code>eventObj</code>
2517
2518 </li>
2519
2520 <li class="arg">
2521
2522 <code class="optional">[bubbles]</code>
2523
2524 </li>
2525
2526 <li class="arg">
2527
2528 <code class="optional">[cancelable]</code>
2529
2530 </li>
2531
2532 </ul><span class="paren">)</span>
2533 </div>
2534
2535
2536
2537 <span class="returns-inline">
2538 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
2539 </span>
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554 <div class="meta">
2555
2556
2557 <p>Inherited from
2558 <a href="../classes/EventDispatcher.html#method_dispatchEvent">EventDispatcher</a>:
2559
2560
2561
2562 <a href="../files/createjs_events_EventDispatcher.js.html#l285"><code>dispatchEvent:285</code></a>
2563
2564 </p>
2565
2566
2567
2568
2569
2570 </div>
2571
2572 <div class="description">
2573 <p><p>Dispatches the specified event to all listeners.</p></p>
2574<h4>Example</h4>
2575
2576<pre class="code prettyprint"><code> // Use a string event
2577 this.dispatchEvent("complete");
2578
2579 // Use an Event instance
2580 var event = new createjs.Event("progress");
2581 this.dispatchEvent(event);</code></pre>
2582
2583 </div>
2584
2585
2586 <div class="params">
2587 <h4>Parameters:</h4>
2588
2589 <ul class="params-list">
2590
2591 <li class="param">
2592
2593 <code class="param-name">eventObj</code>
2594 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a> | <a href="../classes/Event.html" class="crosslink">Event</a></span>
2595
2596
2597
2598
2599 <div class="param-description">
2600 <p>An object with a "type" property, or a string type.
2601While a generic object will work, it is recommended to use a CreateJS Event instance. If a string is used,
2602dispatchEvent will construct an Event instance if necessary with the specified type. This latter approach can
2603be used to avoid event object instantiation for non-bubbling events that may not have any listeners.</p>
2604
2605 </div>
2606
2607
2608 </li>
2609
2610 <li class="param">
2611
2612 <code class="param-name optional">[bubbles]</code>
2613 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
2614 <span class="flag optional" title="This parameter is optional.">optional</span>
2615
2616
2617
2618
2619 <div class="param-description">
2620 <p>Specifies the <code>bubbles</code> value when a string was passed to eventObj.</p>
2621
2622 </div>
2623
2624
2625 </li>
2626
2627 <li class="param">
2628
2629 <code class="param-name optional">[cancelable]</code>
2630 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
2631 <span class="flag optional" title="This parameter is optional.">optional</span>
2632
2633
2634
2635
2636 <div class="param-description">
2637 <p>Specifies the <code>cancelable</code> value when a string was passed to eventObj.</p>
2638
2639 </div>
2640
2641
2642 </li>
2643
2644 </ul>
2645 </div>
2646
2647
2648
2649 <div class="returns">
2650 <h4>Returns:</h4>
2651
2652 <div class="returns-description">
2653
2654
2655 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
2656
2657 <p>Returns false if <code>preventDefault()</code> was called on a cancelable event, true otherwise.</p>
2658
2659
2660 </div>
2661 </div>
2662
2663
2664
2665</div>
2666
2667
2668 <div id="method_draw" class="method item">
2669 <h3 class="name"><code>draw</code></h3>
2670
2671
2672 <div class="args">
2673 <span class="paren">(</span><ul class="args-list inline commas">
2674
2675 <li class="arg">
2676
2677 <code>ctx</code>
2678
2679 </li>
2680
2681 <li class="arg">
2682
2683 <code class="optional">[ignoreCache=false]</code>
2684
2685 </li>
2686
2687 </ul><span class="paren">)</span>
2688 </div>
2689
2690
2691
2692 <span class="returns-inline">
2693 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
2694 </span>
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709 <div class="meta">
2710
2711
2712
2713 <p>
2714
2715 Defined in
2716
2717
2718
2719
2720 <a href="../files/easeljs_display_DisplayObject.js.html#l741"><code>draw:741</code></a>
2721
2722 </p>
2723
2724
2725
2726
2727
2728 </div>
2729
2730 <div class="description">
2731 <p>Draws the display object into the specified context ignoring its visible, alpha, shadow, and transform.
2732Returns <code>true</code> if the draw was handled (useful for overriding functionality).</p>
2733<p>NOTE: This method is mainly for internal use, though it may be useful for advanced uses.</p>
2734
2735 </div>
2736
2737
2738 <div class="params">
2739 <h4>Parameters:</h4>
2740
2741 <ul class="params-list">
2742
2743 <li class="param">
2744
2745 <code class="param-name">ctx</code>
2746 <span class="type">CanvasRenderingContext2D</span>
2747
2748
2749
2750
2751 <div class="param-description">
2752 <p>The canvas 2D context object to draw into.</p>
2753
2754 </div>
2755
2756
2757 </li>
2758
2759 <li class="param">
2760
2761 <code class="param-name optional">[ignoreCache=false]</code>
2762 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
2763 <span class="flag optional" title="This parameter is optional.">optional</span>
2764
2765
2766
2767
2768 <div class="param-description">
2769 <p>Indicates whether the draw operation should ignore any current cache. For example,
2770used for drawing the cache (to prevent it from simply drawing an existing cache back into itself).</p>
2771
2772 </div>
2773
2774
2775 </li>
2776
2777 </ul>
2778 </div>
2779
2780
2781
2782 <div class="returns">
2783 <h4>Returns:</h4>
2784
2785 <div class="returns-description">
2786
2787
2788 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
2789
2790
2791 </div>
2792 </div>
2793
2794
2795
2796</div>
2797
2798
2799 <div id="method_getBounds" class="method item">
2800 <h3 class="name"><code>getBounds</code></h3>
2801
2802
2803 <span class="paren">()</span>
2804
2805
2806
2807 <span class="returns-inline">
2808 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
2809 </span>
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824 <div class="meta">
2825
2826
2827
2828 <p>
2829
2830 Defined in
2831
2832
2833
2834
2835 <a href="../files/easeljs_display_DisplayObject.js.html#l1089"><code>getBounds:1089</code></a>
2836
2837 </p>
2838
2839
2840
2841
2842
2843 </div>
2844
2845 <div class="description">
2846 <p>Returns a rectangle representing this object's bounds in its local coordinate system (ie. with no transformation).
2847Objects that have been cached will return the bounds of the cache.</p>
2848<p>Not all display objects can calculate their own bounds (ex. Shape). For these objects, you can use
2849<a href="../classes/DisplayObject.html#method_setBounds" class="crosslink">setBounds</a> so that they are included when calculating Container
2850bounds.</p>
2851<table>
2852 <tr><td><b>All</b></td><td>
2853 All display objects support setting bounds manually using setBounds(). Likewise, display objects that
2854 have been cached using cache() will return the bounds of their cache. Manual and cache bounds will override
2855 the automatic calculations listed below.
2856 </td></tr>
2857 <tr><td><b>Bitmap</b></td><td>
2858 Returns the width and height of the sourceRect (if specified) or image, extending from (x=0,y=0).
2859 </td></tr>
2860 <tr><td><b>Sprite</b></td><td>
2861 Returns the bounds of the current frame. May have non-zero x/y if a frame registration point was specified
2862 in the spritesheet data. See also <a href="../classes/SpriteSheet.html#method_getFrameBounds" class="crosslink">getFrameBounds</a>
2863 </td></tr>
2864 <tr><td><b>Container</b></td><td>
2865 Returns the aggregate (combined) bounds of all children that return a non-null value from getBounds().
2866 </td></tr>
2867 <tr><td><b>Shape</b></td><td>
2868 Does not currently support automatic bounds calculations. Use setBounds() to manually define bounds.
2869 </td></tr>
2870 <tr><td><b>Text</b></td><td>
2871 Returns approximate bounds. Horizontal values (x/width) are quite accurate, but vertical values (y/height) are
2872 not, especially when using textBaseline values other than "top".
2873 </td></tr>
2874 <tr><td><b>BitmapText</b></td><td>
2875 Returns approximate bounds. Values will be more accurate if spritesheet frame registration points are close
2876 to (x=0,y=0).
2877 </td></tr>
2878</table>
2879
2880<p>Bounds can be expensive to calculate for some objects (ex. text, or containers with many children), and
2881are recalculated each time you call getBounds(). You can prevent recalculation on static objects by setting the
2882bounds explicitly:</p>
2883<pre class="code prettyprint"><code>var bounds = obj.getBounds();
2884obj.setBounds(bounds.x, bounds.y, bounds.width, bounds.height);
2885// getBounds will now use the set values, instead of recalculating</code></pre>
2886<p>To reduce memory impact, the returned Rectangle instance may be reused internally; clone the instance or copy its
2887values if you need to retain it.</p>
2888<pre class="code prettyprint"><code>var myBounds = obj.getBounds().clone();
2889// OR:
2890myRect.copy(obj.getBounds());</code></pre>
2891
2892 </div>
2893
2894
2895
2896
2897 <div class="returns">
2898 <h4>Returns:</h4>
2899
2900 <div class="returns-description">
2901
2902
2903 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
2904
2905 <p>A Rectangle instance representing the bounds, or null if bounds are not available for this
2906object.</p>
2907
2908
2909 </div>
2910 </div>
2911
2912
2913
2914</div>
2915
2916
2917 <div id="method_getCacheDataURL" class="method item">
2918 <h3 class="name"><code>getCacheDataURL</code></h3>
2919
2920
2921 <span class="paren">()</span>
2922
2923
2924
2925 <span class="returns-inline">
2926 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
2927 </span>
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942 <div class="meta">
2943
2944
2945
2946 <p>
2947
2948 Defined in
2949
2950
2951
2952
2953 <a href="../files/easeljs_display_DisplayObject.js.html#l875"><code>getCacheDataURL:875</code></a>
2954
2955 </p>
2956
2957
2958
2959
2960
2961 </div>
2962
2963 <div class="description">
2964 <p>Returns a data URL for the cache, or null if this display object is not cached.
2965Only generated if the cache has changed, otherwise returns last result.</p>
2966
2967 </div>
2968
2969
2970
2971
2972 <div class="returns">
2973 <h4>Returns:</h4>
2974
2975 <div class="returns-description">
2976
2977
2978 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>:
2979
2980 <p>The image data url for the cache.</p>
2981
2982
2983 </div>
2984 </div>
2985
2986
2987
2988</div>
2989
2990
2991 <div id="method_getConcatenatedDisplayProps" class="method item">
2992 <h3 class="name"><code>getConcatenatedDisplayProps</code></h3>
2993
2994
2995 <div class="args">
2996 <span class="paren">(</span><ul class="args-list inline commas">
2997
2998 <li class="arg">
2999
3000 <code class="optional">[props]</code>
3001
3002 </li>
3003
3004 </ul><span class="paren">)</span>
3005 </div>
3006
3007
3008
3009 <span class="returns-inline">
3010 <span class="type"><a href="../classes/DisplayProps.html" class="crosslink">DisplayProps</a></span>
3011 </span>
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026 <div class="meta">
3027
3028
3029
3030 <p>
3031
3032 Defined in
3033
3034
3035
3036
3037 <a href="../files/easeljs_display_DisplayObject.js.html#l1021"><code>getConcatenatedDisplayProps:1021</code></a>
3038
3039 </p>
3040
3041
3042
3043
3044
3045 </div>
3046
3047 <div class="description">
3048 <p>Generates a DisplayProps object representing the combined display properties of the object and all of its
3049parent Containers up to the highest level ancestor (usually the <a href="../classes/Stage.html" class="crosslink">Stage</a>).</p>
3050
3051 </div>
3052
3053
3054 <div class="params">
3055 <h4>Parameters:</h4>
3056
3057 <ul class="params-list">
3058
3059 <li class="param">
3060
3061 <code class="param-name optional">[props]</code>
3062 <span class="type"><a href="../classes/DisplayProps.html" class="crosslink">DisplayProps</a></span>
3063 <span class="flag optional" title="This parameter is optional.">optional</span>
3064
3065
3066
3067
3068 <div class="param-description">
3069 <p>A <a href="../classes/DisplayProps.html" class="crosslink">DisplayProps</a> object to populate with the calculated values.
3070If null, a new DisplayProps object is returned.</p>
3071
3072 </div>
3073
3074
3075 </li>
3076
3077 </ul>
3078 </div>
3079
3080
3081
3082 <div class="returns">
3083 <h4>Returns:</h4>
3084
3085 <div class="returns-description">
3086
3087
3088 <span class="type"><a href="../classes/DisplayProps.html" class="crosslink">DisplayProps</a></span>:
3089
3090 <p>The combined display properties.</p>
3091
3092
3093 </div>
3094 </div>
3095
3096
3097
3098</div>
3099
3100
3101 <div id="method_getConcatenatedMatrix" class="method item">
3102 <h3 class="name"><code>getConcatenatedMatrix</code></h3>
3103
3104
3105 <div class="args">
3106 <span class="paren">(</span><ul class="args-list inline commas">
3107
3108 <li class="arg">
3109
3110 <code class="optional">[matrix]</code>
3111
3112 </li>
3113
3114 </ul><span class="paren">)</span>
3115 </div>
3116
3117
3118
3119 <span class="returns-inline">
3120 <span class="type"><a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a></span>
3121 </span>
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136 <div class="meta">
3137
3138
3139
3140 <p>
3141
3142 Defined in
3143
3144
3145
3146
3147 <a href="../files/easeljs_display_DisplayObject.js.html#l1003"><code>getConcatenatedMatrix:1003</code></a>
3148
3149 </p>
3150
3151
3152
3153
3154
3155 </div>
3156
3157 <div class="description">
3158 <p>Generates a Matrix2D object representing the combined transform of the display object and all of its
3159parent Containers up to the highest level ancestor (usually the <a href="../classes/Stage.html" class="crosslink">Stage</a>). This can
3160be used to transform positions between coordinate spaces, such as with <a href="../classes/DisplayObject.html#method_localToGlobal" class="crosslink">localToGlobal</a>
3161and <a href="../classes/DisplayObject.html#method_globalToLocal" class="crosslink">globalToLocal</a>.</p>
3162
3163 </div>
3164
3165
3166 <div class="params">
3167 <h4>Parameters:</h4>
3168
3169 <ul class="params-list">
3170
3171 <li class="param">
3172
3173 <code class="param-name optional">[matrix]</code>
3174 <span class="type"><a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a></span>
3175 <span class="flag optional" title="This parameter is optional.">optional</span>
3176
3177
3178
3179
3180 <div class="param-description">
3181 <p>A <a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a> object to populate with the calculated values.
3182If null, a new Matrix2D object is returned.</p>
3183
3184 </div>
3185
3186
3187 </li>
3188
3189 </ul>
3190 </div>
3191
3192
3193
3194 <div class="returns">
3195 <h4>Returns:</h4>
3196
3197 <div class="returns-description">
3198
3199
3200 <span class="type"><a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a></span>:
3201
3202 <p>The combined matrix.</p>
3203
3204
3205 </div>
3206 </div>
3207
3208
3209
3210</div>
3211
3212
3213 <div id="method_getMatrix" class="method item">
3214 <h3 class="name"><code>getMatrix</code></h3>
3215
3216
3217 <div class="args">
3218 <span class="paren">(</span><ul class="args-list inline commas">
3219
3220 <li class="arg">
3221
3222 <code>matrix</code>
3223
3224 </li>
3225
3226 </ul><span class="paren">)</span>
3227 </div>
3228
3229
3230
3231 <span class="returns-inline">
3232 <span class="type"><a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a></span>
3233 </span>
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248 <div class="meta">
3249
3250
3251
3252 <p>
3253
3254 Defined in
3255
3256
3257
3258
3259 <a href="../files/easeljs_display_DisplayObject.js.html#l991"><code>getMatrix:991</code></a>
3260
3261 </p>
3262
3263
3264
3265
3266
3267 </div>
3268
3269 <div class="description">
3270 <p>Returns a matrix based on this object's current transform.</p>
3271
3272 </div>
3273
3274
3275 <div class="params">
3276 <h4>Parameters:</h4>
3277
3278 <ul class="params-list">
3279
3280 <li class="param">
3281
3282 <code class="param-name">matrix</code>
3283 <span class="type"><a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a></span>
3284
3285
3286
3287
3288 <div class="param-description">
3289 <p>Optional. A Matrix2D object to populate with the calculated values. If null, a new
3290Matrix object is returned.</p>
3291
3292 </div>
3293
3294
3295 </li>
3296
3297 </ul>
3298 </div>
3299
3300
3301
3302 <div class="returns">
3303 <h4>Returns:</h4>
3304
3305 <div class="returns-description">
3306
3307
3308 <span class="type"><a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a></span>:
3309
3310 <p>A matrix representing this display object's transform.</p>
3311
3312
3313 </div>
3314 </div>
3315
3316
3317
3318</div>
3319
3320
3321 <div id="method_getTransformedBounds" class="method item">
3322 <h3 class="name"><code>getTransformedBounds</code></h3>
3323
3324
3325 <span class="paren">()</span>
3326
3327
3328
3329 <span class="returns-inline">
3330 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
3331 </span>
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346 <div class="meta">
3347
3348
3349
3350 <p>
3351
3352 Defined in
3353
3354
3355
3356
3357 <a href="../files/easeljs_display_DisplayObject.js.html#l1155"><code>getTransformedBounds:1155</code></a>
3358
3359 </p>
3360
3361
3362
3363
3364
3365 </div>
3366
3367 <div class="description">
3368 <p>Returns a rectangle representing this object's bounds in its parent's coordinate system (ie. with transformations applied).
3369Objects that have been cached will return the transformed bounds of the cache.</p>
3370<p>Not all display objects can calculate their own bounds (ex. Shape). For these objects, you can use
3371<a href="../classes/DisplayObject.html#method_setBounds" class="crosslink">setBounds</a> so that they are included when calculating Container
3372bounds.</p>
3373<p>To reduce memory impact, the returned Rectangle instance may be reused internally; clone the instance or copy its
3374values if you need to retain it.</p>
3375<p>Container instances calculate aggregate bounds for all children that return bounds via getBounds.</p>
3376
3377 </div>
3378
3379
3380
3381
3382 <div class="returns">
3383 <h4>Returns:</h4>
3384
3385 <div class="returns-description">
3386
3387
3388 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
3389
3390 <p>A Rectangle instance representing the bounds, or null if bounds are not available for this object.</p>
3391
3392
3393 </div>
3394 </div>
3395
3396
3397
3398</div>
3399
3400
3401 <div id="method_globalToLocal" class="method item">
3402 <h3 class="name"><code>globalToLocal</code></h3>
3403
3404
3405 <div class="args">
3406 <span class="paren">(</span><ul class="args-list inline commas">
3407
3408 <li class="arg">
3409
3410 <code>x</code>
3411
3412 </li>
3413
3414 <li class="arg">
3415
3416 <code>y</code>
3417
3418 </li>
3419
3420 <li class="arg">
3421
3422 <code class="optional">[pt]</code>
3423
3424 </li>
3425
3426 </ul><span class="paren">)</span>
3427 </div>
3428
3429
3430
3431 <span class="returns-inline">
3432 <span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
3433 </span>
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448 <div class="meta">
3449
3450
3451
3452 <p>
3453
3454 Defined in
3455
3456
3457
3458
3459 <a href="../files/easeljs_display_DisplayObject.js.html#l910"><code>globalToLocal:910</code></a>
3460
3461 </p>
3462
3463
3464
3465
3466
3467 </div>
3468
3469 <div class="description">
3470 <p>Transforms the specified x and y position from the global (stage) coordinate space to the
3471coordinate space of the display object. For example, this could be used to determine
3472the current mouse position within the display object. Returns a Point instance with x and y properties
3473correlating to the transformed position in the display object's coordinate space.</p>
3474<h4>Example</h4>
3475
3476<pre class="code prettyprint"><code> displayObject.x = 300;
3477 displayObject.y = 200;
3478 stage.addChild(displayObject);
3479 var point = displayObject.globalToLocal(100, 100);
3480 // Results in x=-200, y=-100</code></pre>
3481
3482 </div>
3483
3484
3485 <div class="params">
3486 <h4>Parameters:</h4>
3487
3488 <ul class="params-list">
3489
3490 <li class="param">
3491
3492 <code class="param-name">x</code>
3493 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
3494
3495
3496
3497
3498 <div class="param-description">
3499 <p>The x position on the stage to transform.</p>
3500
3501 </div>
3502
3503
3504 </li>
3505
3506 <li class="param">
3507
3508 <code class="param-name">y</code>
3509 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
3510
3511
3512
3513
3514 <div class="param-description">
3515 <p>The y position on the stage to transform.</p>
3516
3517 </div>
3518
3519
3520 </li>
3521
3522 <li class="param">
3523
3524 <code class="param-name optional">[pt]</code>
3525 <span class="type"><a href="../classes/Point.html" class="crosslink">Point</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
3526 <span class="flag optional" title="This parameter is optional.">optional</span>
3527
3528
3529
3530
3531 <div class="param-description">
3532 <p>An object to copy the result into. If omitted a new Point object with x/y properties will be returned.</p>
3533
3534 </div>
3535
3536
3537 </li>
3538
3539 </ul>
3540 </div>
3541
3542
3543
3544 <div class="returns">
3545 <h4>Returns:</h4>
3546
3547 <div class="returns-description">
3548
3549
3550 <span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>:
3551
3552 <p>A Point instance with x and y properties correlating to the transformed position in the
3553display object's coordinate space.</p>
3554
3555
3556 </div>
3557 </div>
3558
3559
3560
3561</div>
3562
3563
3564 <div id="method_hasEventListener" class="method item inherited">
3565 <h3 class="name"><code>hasEventListener</code></h3>
3566
3567
3568 <div class="args">
3569 <span class="paren">(</span><ul class="args-list inline commas">
3570
3571 <li class="arg">
3572
3573 <code>type</code>
3574
3575 </li>
3576
3577 </ul><span class="paren">)</span>
3578 </div>
3579
3580
3581
3582 <span class="returns-inline">
3583 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
3584 </span>
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599 <div class="meta">
3600
3601
3602 <p>Inherited from
3603 <a href="../classes/EventDispatcher.html#method_hasEventListener">EventDispatcher</a>:
3604
3605
3606
3607 <a href="../files/createjs_events_EventDispatcher.js.html#l339"><code>hasEventListener:339</code></a>
3608
3609 </p>
3610
3611
3612
3613
3614
3615 </div>
3616
3617 <div class="description">
3618 <p>Indicates whether there is at least one listener for the specified event type.</p>
3619
3620 </div>
3621
3622
3623 <div class="params">
3624 <h4>Parameters:</h4>
3625
3626 <ul class="params-list">
3627
3628 <li class="param">
3629
3630 <code class="param-name">type</code>
3631 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
3632
3633
3634
3635
3636 <div class="param-description">
3637 <p>The string type of the event.</p>
3638
3639 </div>
3640
3641
3642 </li>
3643
3644 </ul>
3645 </div>
3646
3647
3648
3649 <div class="returns">
3650 <h4>Returns:</h4>
3651
3652 <div class="returns-description">
3653
3654
3655 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
3656
3657 <p>Returns true if there is at least one listener for the specified event.</p>
3658
3659
3660 </div>
3661 </div>
3662
3663
3664
3665</div>
3666
3667
3668 <div id="method_hitTest" class="method item">
3669 <h3 class="name"><code>hitTest</code></h3>
3670
3671
3672 <div class="args">
3673 <span class="paren">(</span><ul class="args-list inline commas">
3674
3675 <li class="arg">
3676
3677 <code>x</code>
3678
3679 </li>
3680
3681 <li class="arg">
3682
3683 <code>y</code>
3684
3685 </li>
3686
3687 </ul><span class="paren">)</span>
3688 </div>
3689
3690
3691
3692 <span class="returns-inline">
3693 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
3694 </span>
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709 <div class="meta">
3710
3711
3712
3713 <p>
3714
3715 Defined in
3716
3717
3718
3719
3720 <a href="../files/easeljs_display_DisplayObject.js.html#l1042"><code>hitTest:1042</code></a>
3721
3722 </p>
3723
3724
3725
3726
3727
3728 </div>
3729
3730 <div class="description">
3731 <p>Tests whether the display object intersects the specified point in local coordinates (ie. draws a pixel with alpha > 0 at
3732the specified position). This ignores the alpha, shadow, hitArea, mask, and compositeOperation of the display object.</p>
3733<h4>Example</h4>
3734
3735<pre class="code prettyprint"><code> stage.addEventListener("stagemousedown", handleMouseDown);
3736 function handleMouseDown(event) {
3737 var hit = myShape.hitTest(event.stageX, event.stageY);
3738 }</code></pre>
3739<p>Please note that shape-to-shape collision is not currently supported by EaselJS.</p>
3740
3741 </div>
3742
3743
3744 <div class="params">
3745 <h4>Parameters:</h4>
3746
3747 <ul class="params-list">
3748
3749 <li class="param">
3750
3751 <code class="param-name">x</code>
3752 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
3753
3754
3755
3756
3757 <div class="param-description">
3758 <p>The x position to check in the display object's local coordinates.</p>
3759
3760 </div>
3761
3762
3763 </li>
3764
3765 <li class="param">
3766
3767 <code class="param-name">y</code>
3768 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
3769
3770
3771
3772
3773 <div class="param-description">
3774 <p>The y position to check in the display object's local coordinates.</p>
3775
3776 </div>
3777
3778
3779 </li>
3780
3781 </ul>
3782 </div>
3783
3784
3785
3786 <div class="returns">
3787 <h4>Returns:</h4>
3788
3789 <div class="returns-description">
3790
3791
3792 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
3793
3794 <p>A Boolean indicating whether a visible portion of the DisplayObject intersect the specified
3795local Point.</p>
3796
3797
3798 </div>
3799 </div>
3800
3801
3802
3803</div>
3804
3805
3806 <div id="method_isVisible" class="method item">
3807 <h3 class="name"><code>isVisible</code></h3>
3808
3809
3810 <span class="paren">()</span>
3811
3812
3813
3814 <span class="returns-inline">
3815 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
3816 </span>
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831 <div class="meta">
3832
3833
3834
3835 <p>
3836
3837 Defined in
3838
3839
3840
3841
3842 <a href="../files/easeljs_display_DisplayObject.js.html#l729"><code>isVisible:729</code></a>
3843
3844 </p>
3845
3846
3847
3848
3849
3850 </div>
3851
3852 <div class="description">
3853 <p>Returns true or false indicating whether the display object would be visible if drawn to a canvas.
3854This does not account for whether it would be visible within the boundaries of the stage.</p>
3855<p>NOTE: This method is mainly for internal use, though it may be useful for advanced uses.</p>
3856
3857 </div>
3858
3859
3860
3861
3862 <div class="returns">
3863 <h4>Returns:</h4>
3864
3865 <div class="returns-description">
3866
3867
3868 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
3869
3870 <p>Boolean indicating whether the display object would be visible if drawn to a canvas</p>
3871
3872
3873 </div>
3874 </div>
3875
3876
3877
3878</div>
3879
3880
3881 <div id="method_localToGlobal" class="method item">
3882 <h3 class="name"><code>localToGlobal</code></h3>
3883
3884
3885 <div class="args">
3886 <span class="paren">(</span><ul class="args-list inline commas">
3887
3888 <li class="arg">
3889
3890 <code>x</code>
3891
3892 </li>
3893
3894 <li class="arg">
3895
3896 <code>y</code>
3897
3898 </li>
3899
3900 <li class="arg">
3901
3902 <code class="optional">[pt]</code>
3903
3904 </li>
3905
3906 </ul><span class="paren">)</span>
3907 </div>
3908
3909
3910
3911 <span class="returns-inline">
3912 <span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
3913 </span>
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928 <div class="meta">
3929
3930
3931
3932 <p>
3933
3934 Defined in
3935
3936
3937
3938
3939 <a href="../files/easeljs_display_DisplayObject.js.html#l885"><code>localToGlobal:885</code></a>
3940
3941 </p>
3942
3943
3944
3945
3946
3947 </div>
3948
3949 <div class="description">
3950 <p>Transforms the specified x and y position from the coordinate space of the display object
3951to the global (stage) coordinate space. For example, this could be used to position an HTML label
3952over a specific point on a nested display object. Returns a Point instance with x and y properties
3953correlating to the transformed coordinates on the stage.</p>
3954<h4>Example</h4>
3955
3956<pre class="code prettyprint"><code> displayObject.x = 300;
3957 displayObject.y = 200;
3958 stage.addChild(displayObject);
3959 var point = displayObject.localToGlobal(100, 100);
3960 // Results in x=400, y=300</code></pre>
3961
3962 </div>
3963
3964
3965 <div class="params">
3966 <h4>Parameters:</h4>
3967
3968 <ul class="params-list">
3969
3970 <li class="param">
3971
3972 <code class="param-name">x</code>
3973 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
3974
3975
3976
3977
3978 <div class="param-description">
3979 <p>The x position in the source display object to transform.</p>
3980
3981 </div>
3982
3983
3984 </li>
3985
3986 <li class="param">
3987
3988 <code class="param-name">y</code>
3989 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
3990
3991
3992
3993
3994 <div class="param-description">
3995 <p>The y position in the source display object to transform.</p>
3996
3997 </div>
3998
3999
4000 </li>
4001
4002 <li class="param">
4003
4004 <code class="param-name optional">[pt]</code>
4005 <span class="type"><a href="../classes/Point.html" class="crosslink">Point</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
4006 <span class="flag optional" title="This parameter is optional.">optional</span>
4007
4008
4009
4010
4011 <div class="param-description">
4012 <p>An object to copy the result into. If omitted a new Point object with x/y properties will be returned.</p>
4013
4014 </div>
4015
4016
4017 </li>
4018
4019 </ul>
4020 </div>
4021
4022
4023
4024 <div class="returns">
4025 <h4>Returns:</h4>
4026
4027 <div class="returns-description">
4028
4029
4030 <span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>:
4031
4032 <p>A Point instance with x and y properties correlating to the transformed coordinates
4033on the stage.</p>
4034
4035
4036 </div>
4037 </div>
4038
4039
4040
4041</div>
4042
4043
4044 <div id="method_localToLocal" class="method item">
4045 <h3 class="name"><code>localToLocal</code></h3>
4046
4047
4048 <div class="args">
4049 <span class="paren">(</span><ul class="args-list inline commas">
4050
4051 <li class="arg">
4052
4053 <code>x</code>
4054
4055 </li>
4056
4057 <li class="arg">
4058
4059 <code>y</code>
4060
4061 </li>
4062
4063 <li class="arg">
4064
4065 <code>target</code>
4066
4067 </li>
4068
4069 <li class="arg">
4070
4071 <code class="optional">[pt]</code>
4072
4073 </li>
4074
4075 </ul><span class="paren">)</span>
4076 </div>
4077
4078
4079
4080 <span class="returns-inline">
4081 <span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>
4082 </span>
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097 <div class="meta">
4098
4099
4100
4101 <p>
4102
4103 Defined in
4104
4105
4106
4107
4108 <a href="../files/easeljs_display_DisplayObject.js.html#l935"><code>localToLocal:935</code></a>
4109
4110 </p>
4111
4112
4113
4114
4115
4116 </div>
4117
4118 <div class="description">
4119 <p>Transforms the specified x and y position from the coordinate space of this display object to the coordinate
4120space of the target display object. Returns a Point instance with x and y properties correlating to the
4121transformed position in the target's coordinate space. Effectively the same as using the following code with
4122<a href="../classes/DisplayObject.html#method_localToGlobal" class="crosslink">localToGlobal</a> and <a href="../classes/DisplayObject.html#method_globalToLocal" class="crosslink">globalToLocal</a>.</p>
4123<pre class="code prettyprint"><code> var pt = this.localToGlobal(x, y);
4124 pt = target.globalToLocal(pt.x, pt.y);</code></pre>
4125
4126 </div>
4127
4128
4129 <div class="params">
4130 <h4>Parameters:</h4>
4131
4132 <ul class="params-list">
4133
4134 <li class="param">
4135
4136 <code class="param-name">x</code>
4137 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
4138
4139
4140
4141
4142 <div class="param-description">
4143 <p>The x position in the source display object to transform.</p>
4144
4145 </div>
4146
4147
4148 </li>
4149
4150 <li class="param">
4151
4152 <code class="param-name">y</code>
4153 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
4154
4155
4156
4157
4158 <div class="param-description">
4159 <p>The y position on the source display object to transform.</p>
4160
4161 </div>
4162
4163
4164 </li>
4165
4166 <li class="param">
4167
4168 <code class="param-name">target</code>
4169 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
4170
4171
4172
4173
4174 <div class="param-description">
4175 <p>The target display object to which the coordinates will be transformed.</p>
4176
4177 </div>
4178
4179
4180 </li>
4181
4182 <li class="param">
4183
4184 <code class="param-name optional">[pt]</code>
4185 <span class="type"><a href="../classes/Point.html" class="crosslink">Point</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
4186 <span class="flag optional" title="This parameter is optional.">optional</span>
4187
4188
4189
4190
4191 <div class="param-description">
4192 <p>An object to copy the result into. If omitted a new Point object with x/y properties will be returned.</p>
4193
4194 </div>
4195
4196
4197 </li>
4198
4199 </ul>
4200 </div>
4201
4202
4203
4204 <div class="returns">
4205 <h4>Returns:</h4>
4206
4207 <div class="returns-description">
4208
4209
4210 <span class="type"><a href="../classes/Point.html" class="crosslink">Point</a></span>:
4211
4212 <p>Returns a Point instance with x and y properties correlating to the transformed position
4213in the target's coordinate space.</p>
4214
4215
4216 </div>
4217 </div>
4218
4219
4220
4221</div>
4222
4223
4224 <div id="method_off" class="method item inherited">
4225 <h3 class="name"><code>off</code></h3>
4226
4227
4228 <div class="args">
4229 <span class="paren">(</span><ul class="args-list inline commas">
4230
4231 <li class="arg">
4232
4233 <code>type</code>
4234
4235 </li>
4236
4237 <li class="arg">
4238
4239 <code>listener</code>
4240
4241 </li>
4242
4243 <li class="arg">
4244
4245 <code class="optional">[useCapture]</code>
4246
4247 </li>
4248
4249 </ul><span class="paren">)</span>
4250 </div>
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267 <div class="meta">
4268
4269
4270 <p>Inherited from
4271 <a href="../classes/EventDispatcher.html#method_off">EventDispatcher</a>:
4272
4273
4274
4275 <a href="../files/createjs_events_EventDispatcher.js.html#l249"><code>off:249</code></a>
4276
4277 </p>
4278
4279
4280
4281
4282
4283 </div>
4284
4285 <div class="description">
4286 <p>A shortcut to the removeEventListener method, with the same parameters and return value. This is a companion to the
4287.on method.</p>
4288<p><b>IMPORTANT:</b> To remove a listener added with <code>on</code>, you must pass in the returned wrapper function as the listener. See
4289<a href="../classes/EventDispatcher.html#method_on" class="crosslink">on</a> for an example.</p>
4290
4291 </div>
4292
4293
4294 <div class="params">
4295 <h4>Parameters:</h4>
4296
4297 <ul class="params-list">
4298
4299 <li class="param">
4300
4301 <code class="param-name">type</code>
4302 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
4303
4304
4305
4306
4307 <div class="param-description">
4308 <p>The string type of the event.</p>
4309
4310 </div>
4311
4312
4313 </li>
4314
4315 <li class="param">
4316
4317 <code class="param-name">listener</code>
4318 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
4319
4320
4321
4322
4323 <div class="param-description">
4324 <p>The listener function or object.</p>
4325
4326 </div>
4327
4328
4329 </li>
4330
4331 <li class="param">
4332
4333 <code class="param-name optional">[useCapture]</code>
4334 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
4335 <span class="flag optional" title="This parameter is optional.">optional</span>
4336
4337
4338
4339
4340 <div class="param-description">
4341 <p>For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.</p>
4342
4343 </div>
4344
4345
4346 </li>
4347
4348 </ul>
4349 </div>
4350
4351
4352
4353
4354
4355</div>
4356
4357
4358 <div id="method_on" class="method item inherited">
4359 <h3 class="name"><code>on</code></h3>
4360
4361
4362 <div class="args">
4363 <span class="paren">(</span><ul class="args-list inline commas">
4364
4365 <li class="arg">
4366
4367 <code>type</code>
4368
4369 </li>
4370
4371 <li class="arg">
4372
4373 <code>listener</code>
4374
4375 </li>
4376
4377 <li class="arg">
4378
4379 <code class="optional">[scope]</code>
4380
4381 </li>
4382
4383 <li class="arg">
4384
4385 <code class="optional">[once=false]</code>
4386
4387 </li>
4388
4389 <li class="arg">
4390
4391 <code class="optional">[data]</code>
4392
4393 </li>
4394
4395 <li class="arg">
4396
4397 <code class="optional">[useCapture=false]</code>
4398
4399 </li>
4400
4401 </ul><span class="paren">)</span>
4402 </div>
4403
4404
4405
4406 <span class="returns-inline">
4407 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a></span>
4408 </span>
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423 <div class="meta">
4424
4425
4426 <p>Inherited from
4427 <a href="../classes/EventDispatcher.html#method_on">EventDispatcher</a>:
4428
4429
4430
4431 <a href="../files/createjs_events_EventDispatcher.js.html#l173"><code>on:173</code></a>
4432
4433 </p>
4434
4435
4436
4437
4438
4439 </div>
4440
4441 <div class="description">
4442 <p><p>A shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener
4443only run once, associate arbitrary data with the listener, and remove the listener.</p></p>
4444<p><p>This method works by creating an anonymous wrapper function and subscribing it with addEventListener.
4445The wrapper function is returned for use with <code>removeEventListener</code> (or <code>off</code>).</p></p>
4446<p><p><b>IMPORTANT:</b> To remove a listener added with <code>on</code>, you must pass in the returned wrapper function as the listener, or use
4447<a href="../classes/Event.html#method_remove" class="crosslink">remove</a>. Likewise, each time you call <code>on</code> a NEW wrapper function is subscribed, so multiple calls
4448to <code>on</code> with the same params will create multiple listeners.</p></p>
4449<h4>Example</h4>
4450
4451<pre class="code prettyprint"><code> var listener = myBtn.on("click", handleClick, null, false, {count:3});
4452 function handleClick(evt, data) {
4453 data.count -= 1;
4454 console.log(this == myBtn); // true - scope defaults to the dispatcher
4455 if (data.count == 0) {
4456 alert("clicked 3 times!");
4457 myBtn.off("click", listener);
4458 // alternately: evt.remove();
4459 }
4460 }</code></pre>
4461
4462 </div>
4463
4464
4465 <div class="params">
4466 <h4>Parameters:</h4>
4467
4468 <ul class="params-list">
4469
4470 <li class="param">
4471
4472 <code class="param-name">type</code>
4473 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
4474
4475
4476
4477
4478 <div class="param-description">
4479 <p>The string type of the event.</p>
4480
4481 </div>
4482
4483
4484 </li>
4485
4486 <li class="param">
4487
4488 <code class="param-name">listener</code>
4489 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
4490
4491
4492
4493
4494 <div class="param-description">
4495 <p>An object with a handleEvent method, or a function that will be called when
4496the event is dispatched.</p>
4497
4498 </div>
4499
4500
4501 </li>
4502
4503 <li class="param">
4504
4505 <code class="param-name optional">[scope]</code>
4506 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
4507 <span class="flag optional" title="This parameter is optional.">optional</span>
4508
4509
4510
4511
4512 <div class="param-description">
4513 <p>The scope to execute the listener in. Defaults to the dispatcher/currentTarget for function listeners, and to the listener itself for object listeners (ie. using handleEvent).</p>
4514
4515 </div>
4516
4517
4518 </li>
4519
4520 <li class="param">
4521
4522 <code class="param-name optional">[once=false]</code>
4523 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
4524 <span class="flag optional" title="This parameter is optional.">optional</span>
4525
4526
4527
4528
4529 <div class="param-description">
4530 <p>If true, the listener will remove itself after the first time it is triggered.</p>
4531
4532 </div>
4533
4534
4535 </li>
4536
4537 <li class="param">
4538
4539 <code class="param-name optional">[data]</code>
4540 <span class="type"></span>
4541 <span class="flag optional" title="This parameter is optional.">optional</span>
4542
4543
4544
4545
4546 <div class="param-description">
4547 <p>Arbitrary data that will be included as the second parameter when the listener is called.</p>
4548
4549 </div>
4550
4551
4552 </li>
4553
4554 <li class="param">
4555
4556 <code class="param-name optional">[useCapture=false]</code>
4557 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
4558 <span class="flag optional" title="This parameter is optional.">optional</span>
4559
4560
4561
4562
4563 <div class="param-description">
4564 <p>For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.</p>
4565
4566 </div>
4567
4568
4569 </li>
4570
4571 </ul>
4572 </div>
4573
4574
4575
4576 <div class="returns">
4577 <h4>Returns:</h4>
4578
4579 <div class="returns-description">
4580
4581
4582 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a></span>:
4583
4584 <p>Returns the anonymous function that was created and assigned as the listener. This is needed to remove the listener later using .removeEventListener.</p>
4585
4586
4587 </div>
4588 </div>
4589
4590
4591
4592</div>
4593
4594
4595 <div id="method_removeAllEventListeners" class="method item inherited">
4596 <h3 class="name"><code>removeAllEventListeners</code></h3>
4597
4598
4599 <div class="args">
4600 <span class="paren">(</span><ul class="args-list inline commas">
4601
4602 <li class="arg">
4603
4604 <code class="optional">[type]</code>
4605
4606 </li>
4607
4608 </ul><span class="paren">)</span>
4609 </div>
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626 <div class="meta">
4627
4628
4629 <p>Inherited from
4630 <a href="../classes/EventDispatcher.html#method_removeAllEventListeners">EventDispatcher</a>:
4631
4632
4633
4634 <a href="../files/createjs_events_EventDispatcher.js.html#l263"><code>removeAllEventListeners:263</code></a>
4635
4636 </p>
4637
4638
4639
4640
4641
4642 </div>
4643
4644 <div class="description">
4645 <p><p>Removes all listeners for the specified type, or all listeners of all types.</p></p>
4646<h4>Example</h4>
4647
4648<pre class="code prettyprint"><code> // Remove all listeners
4649 displayObject.removeAllEventListeners();
4650
4651 // Remove all click listeners
4652 displayObject.removeAllEventListeners("click");</code></pre>
4653
4654 </div>
4655
4656
4657 <div class="params">
4658 <h4>Parameters:</h4>
4659
4660 <ul class="params-list">
4661
4662 <li class="param">
4663
4664 <code class="param-name optional">[type]</code>
4665 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
4666 <span class="flag optional" title="This parameter is optional.">optional</span>
4667
4668
4669
4670
4671 <div class="param-description">
4672 <p>The string type of the event. If omitted, all listeners for all types will be removed.</p>
4673
4674 </div>
4675
4676
4677 </li>
4678
4679 </ul>
4680 </div>
4681
4682
4683
4684
4685
4686</div>
4687
4688
4689 <div id="method_removeEventListener" class="method item inherited">
4690 <h3 class="name"><code>removeEventListener</code></h3>
4691
4692
4693 <div class="args">
4694 <span class="paren">(</span><ul class="args-list inline commas">
4695
4696 <li class="arg">
4697
4698 <code>type</code>
4699
4700 </li>
4701
4702 <li class="arg">
4703
4704 <code>listener</code>
4705
4706 </li>
4707
4708 <li class="arg">
4709
4710 <code class="optional">[useCapture]</code>
4711
4712 </li>
4713
4714 </ul><span class="paren">)</span>
4715 </div>
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732 <div class="meta">
4733
4734
4735 <p>Inherited from
4736 <a href="../classes/EventDispatcher.html#method_removeEventListener">EventDispatcher</a>:
4737
4738
4739
4740 <a href="../files/createjs_events_EventDispatcher.js.html#l219"><code>removeEventListener:219</code></a>
4741
4742 </p>
4743
4744
4745
4746
4747
4748 </div>
4749
4750 <div class="description">
4751 <p><p>Removes the specified event listener.</p></p>
4752<p><p><b>Important Note:</b> that you must pass the exact function reference used when the event was added. If a proxy
4753function, or function closure is used as the callback, the proxy/closure reference must be used - a new proxy or
4754closure will not work.</p></p>
4755<h4>Example</h4>
4756
4757<pre class="code prettyprint"><code> displayObject.removeEventListener("click", handleClick);</code></pre>
4758
4759 </div>
4760
4761
4762 <div class="params">
4763 <h4>Parameters:</h4>
4764
4765 <ul class="params-list">
4766
4767 <li class="param">
4768
4769 <code class="param-name">type</code>
4770 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
4771
4772
4773
4774
4775 <div class="param-description">
4776 <p>The string type of the event.</p>
4777
4778 </div>
4779
4780
4781 </li>
4782
4783 <li class="param">
4784
4785 <code class="param-name">listener</code>
4786 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function" class="crosslink external" target="_blank">Function</a> | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
4787
4788
4789
4790
4791 <div class="param-description">
4792 <p>The listener function or object.</p>
4793
4794 </div>
4795
4796
4797 </li>
4798
4799 <li class="param">
4800
4801 <code class="param-name optional">[useCapture]</code>
4802 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
4803 <span class="flag optional" title="This parameter is optional.">optional</span>
4804
4805
4806
4807
4808 <div class="param-description">
4809 <p>For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase.</p>
4810
4811 </div>
4812
4813
4814 </li>
4815
4816 </ul>
4817 </div>
4818
4819
4820
4821
4822
4823</div>
4824
4825
4826 <div id="method_set" class="method item">
4827 <h3 class="name"><code>set</code></h3>
4828
4829
4830 <div class="args">
4831 <span class="paren">(</span><ul class="args-list inline commas">
4832
4833 <li class="arg">
4834
4835 <code>props</code>
4836
4837 </li>
4838
4839 </ul><span class="paren">)</span>
4840 </div>
4841
4842
4843
4844 <span class="returns-inline">
4845 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
4846 </span>
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858 <span class="flag chainable">chainable</span>
4859
4860
4861
4862
4863 <div class="meta">
4864
4865
4866
4867 <p>
4868
4869 Defined in
4870
4871
4872
4873
4874 <a href="../files/easeljs_display_DisplayObject.js.html#l1071"><code>set:1071</code></a>
4875
4876 </p>
4877
4878
4879
4880
4881
4882 </div>
4883
4884 <div class="description">
4885 <p>Provides a chainable shortcut method for setting a number of properties on the instance.</p>
4886<h4>Example</h4>
4887
4888<pre class="code prettyprint"><code> var myGraphics = new createjs.Graphics().beginFill("#ff0000").drawCircle(0, 0, 25);
4889 var shape = stage.addChild(new Shape()).set({graphics:myGraphics, x:100, y:100, alpha:0.5});</code></pre>
4890
4891 </div>
4892
4893
4894 <div class="params">
4895 <h4>Parameters:</h4>
4896
4897 <ul class="params-list">
4898
4899 <li class="param">
4900
4901 <code class="param-name">props</code>
4902 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
4903
4904
4905
4906
4907 <div class="param-description">
4908 <p>A generic object containing properties to copy to the DisplayObject instance.</p>
4909
4910 </div>
4911
4912
4913 </li>
4914
4915 </ul>
4916 </div>
4917
4918
4919
4920 <div class="returns">
4921 <h4>Returns:</h4>
4922
4923 <div class="returns-description">
4924
4925
4926 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>:
4927
4928 <p>Returns the instance the method is called on (useful for chaining calls.)</p>
4929
4930
4931 </div>
4932 </div>
4933
4934
4935
4936</div>
4937
4938
4939 <div id="method_setBounds" class="method item">
4940 <h3 class="name"><code>setBounds</code></h3>
4941
4942
4943 <div class="args">
4944 <span class="paren">(</span><ul class="args-list inline commas">
4945
4946 <li class="arg">
4947
4948 <code>x</code>
4949
4950 </li>
4951
4952 <li class="arg">
4953
4954 <code>y</code>
4955
4956 </li>
4957
4958 <li class="arg">
4959
4960 <code>width</code>
4961
4962 </li>
4963
4964 <li class="arg">
4965
4966 <code>height</code>
4967
4968 </li>
4969
4970 </ul><span class="paren">)</span>
4971 </div>
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988 <div class="meta">
4989
4990
4991
4992 <p>
4993
4994 Defined in
4995
4996
4997
4998
4999 <a href="../files/easeljs_display_DisplayObject.js.html#l1174"><code>setBounds:1174</code></a>
5000
5001 </p>
5002
5003
5004
5005
5006
5007 </div>
5008
5009 <div class="description">
5010 <p>Allows you to manually specify the bounds of an object that either cannot calculate their own bounds (ex. Shape &
5011Text) for future reference, or so the object can be included in Container bounds. Manually set bounds will always
5012override calculated bounds.</p>
5013<p>The bounds should be specified in the object's local (untransformed) coordinates. For example, a Shape instance
5014with a 25px radius circle centered at 0,0 would have bounds of (-25, -25, 50, 50).</p>
5015
5016 </div>
5017
5018
5019 <div class="params">
5020 <h4>Parameters:</h4>
5021
5022 <ul class="params-list">
5023
5024 <li class="param">
5025
5026 <code class="param-name">x</code>
5027 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5028
5029
5030
5031
5032 <div class="param-description">
5033 <p>The x origin of the bounds. Pass null to remove the manual bounds.</p>
5034
5035 </div>
5036
5037
5038 </li>
5039
5040 <li class="param">
5041
5042 <code class="param-name">y</code>
5043 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5044
5045
5046
5047
5048 <div class="param-description">
5049 <p>The y origin of the bounds.</p>
5050
5051 </div>
5052
5053
5054 </li>
5055
5056 <li class="param">
5057
5058 <code class="param-name">width</code>
5059 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5060
5061
5062
5063
5064 <div class="param-description">
5065 <p>The width of the bounds.</p>
5066
5067 </div>
5068
5069
5070 </li>
5071
5072 <li class="param">
5073
5074 <code class="param-name">height</code>
5075 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5076
5077
5078
5079
5080 <div class="param-description">
5081 <p>The height of the bounds.</p>
5082
5083 </div>
5084
5085
5086 </li>
5087
5088 </ul>
5089 </div>
5090
5091
5092
5093
5094
5095</div>
5096
5097
5098 <div id="method_setTransform" class="method item">
5099 <h3 class="name"><code>setTransform</code></h3>
5100
5101
5102 <div class="args">
5103 <span class="paren">(</span><ul class="args-list inline commas">
5104
5105 <li class="arg">
5106
5107 <code class="optional">[x=0]</code>
5108
5109 </li>
5110
5111 <li class="arg">
5112
5113 <code class="optional">[y=0]</code>
5114
5115 </li>
5116
5117 <li class="arg">
5118
5119 <code class="optional">[scaleX=1]</code>
5120
5121 </li>
5122
5123 <li class="arg">
5124
5125 <code class="optional">[scaleY=1]</code>
5126
5127 </li>
5128
5129 <li class="arg">
5130
5131 <code class="optional">[rotation=0]</code>
5132
5133 </li>
5134
5135 <li class="arg">
5136
5137 <code class="optional">[skewX=0]</code>
5138
5139 </li>
5140
5141 <li class="arg">
5142
5143 <code class="optional">[skewY=0]</code>
5144
5145 </li>
5146
5147 <li class="arg">
5148
5149 <code class="optional">[regX=0]</code>
5150
5151 </li>
5152
5153 <li class="arg">
5154
5155 <code class="optional">[regY=0]</code>
5156
5157 </li>
5158
5159 </ul><span class="paren">)</span>
5160 </div>
5161
5162
5163
5164 <span class="returns-inline">
5165 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
5166 </span>
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178 <span class="flag chainable">chainable</span>
5179
5180
5181
5182
5183 <div class="meta">
5184
5185
5186
5187 <p>
5188
5189 Defined in
5190
5191
5192
5193
5194 <a href="../files/easeljs_display_DisplayObject.js.html#l957"><code>setTransform:957</code></a>
5195
5196 </p>
5197
5198
5199
5200
5201
5202 </div>
5203
5204 <div class="description">
5205 <p>Shortcut method to quickly set the transform properties on the display object. All parameters are optional.
5206Omitted parameters will have the default value set.</p>
5207<h4>Example</h4>
5208
5209<pre class="code prettyprint"><code> displayObject.setTransform(100, 100, 2, 2);</code></pre>
5210
5211 </div>
5212
5213
5214 <div class="params">
5215 <h4>Parameters:</h4>
5216
5217 <ul class="params-list">
5218
5219 <li class="param">
5220
5221 <code class="param-name optional">[x=0]</code>
5222 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5223 <span class="flag optional" title="This parameter is optional.">optional</span>
5224
5225
5226
5227
5228 <div class="param-description">
5229 <p>The horizontal translation (x position) in pixels</p>
5230
5231 </div>
5232
5233
5234 </li>
5235
5236 <li class="param">
5237
5238 <code class="param-name optional">[y=0]</code>
5239 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5240 <span class="flag optional" title="This parameter is optional.">optional</span>
5241
5242
5243
5244
5245 <div class="param-description">
5246 <p>The vertical translation (y position) in pixels</p>
5247
5248 </div>
5249
5250
5251 </li>
5252
5253 <li class="param">
5254
5255 <code class="param-name optional">[scaleX=1]</code>
5256 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5257 <span class="flag optional" title="This parameter is optional.">optional</span>
5258
5259
5260
5261
5262 <div class="param-description">
5263 <p>The horizontal scale, as a percentage of 1</p>
5264
5265 </div>
5266
5267
5268 </li>
5269
5270 <li class="param">
5271
5272 <code class="param-name optional">[scaleY=1]</code>
5273 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5274 <span class="flag optional" title="This parameter is optional.">optional</span>
5275
5276
5277
5278
5279 <div class="param-description">
5280 <p>the vertical scale, as a percentage of 1</p>
5281
5282 </div>
5283
5284
5285 </li>
5286
5287 <li class="param">
5288
5289 <code class="param-name optional">[rotation=0]</code>
5290 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5291 <span class="flag optional" title="This parameter is optional.">optional</span>
5292
5293
5294
5295
5296 <div class="param-description">
5297 <p>The rotation, in degrees</p>
5298
5299 </div>
5300
5301
5302 </li>
5303
5304 <li class="param">
5305
5306 <code class="param-name optional">[skewX=0]</code>
5307 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5308 <span class="flag optional" title="This parameter is optional.">optional</span>
5309
5310
5311
5312
5313 <div class="param-description">
5314 <p>The horizontal skew factor</p>
5315
5316 </div>
5317
5318
5319 </li>
5320
5321 <li class="param">
5322
5323 <code class="param-name optional">[skewY=0]</code>
5324 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5325 <span class="flag optional" title="This parameter is optional.">optional</span>
5326
5327
5328
5329
5330 <div class="param-description">
5331 <p>The vertical skew factor</p>
5332
5333 </div>
5334
5335
5336 </li>
5337
5338 <li class="param">
5339
5340 <code class="param-name optional">[regX=0]</code>
5341 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5342 <span class="flag optional" title="This parameter is optional.">optional</span>
5343
5344
5345
5346
5347 <div class="param-description">
5348 <p>The horizontal registration point in pixels</p>
5349
5350 </div>
5351
5352
5353 </li>
5354
5355 <li class="param">
5356
5357 <code class="param-name optional">[regY=0]</code>
5358 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5359 <span class="flag optional" title="This parameter is optional.">optional</span>
5360
5361
5362
5363
5364 <div class="param-description">
5365 <p>The vertical registration point in pixels</p>
5366
5367 </div>
5368
5369
5370 </li>
5371
5372 </ul>
5373 </div>
5374
5375
5376
5377 <div class="returns">
5378 <h4>Returns:</h4>
5379
5380 <div class="returns-description">
5381
5382
5383 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>:
5384
5385 <p>Returns this instance. Useful for chaining commands.</p>
5386
5387
5388 </div>
5389 </div>
5390
5391
5392
5393</div>
5394
5395
5396 <div id="method_toString" class="method item">
5397 <h3 class="name"><code>toString</code></h3>
5398
5399
5400 <span class="paren">()</span>
5401
5402
5403
5404 <span class="returns-inline">
5405 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
5406 </span>
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421 <div class="meta">
5422
5423 <p>Inherited from
5424 <a href="../classes/EventDispatcher.html#method_toString">
5425 EventDispatcher
5426 </a>
5427
5428 but overwritten in
5429
5430
5431
5432 <a href="../files/easeljs_display_DisplayObject.js.html#l1203"><code>toString:1203</code></a>
5433
5434 </p>
5435
5436
5437
5438
5439
5440 </div>
5441
5442 <div class="description">
5443 <p>Returns a string representation of this object.</p>
5444
5445 </div>
5446
5447
5448
5449
5450 <div class="returns">
5451 <h4>Returns:</h4>
5452
5453 <div class="returns-description">
5454
5455
5456 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>:
5457
5458 <p>a string representation of the instance.</p>
5459
5460
5461 </div>
5462 </div>
5463
5464
5465
5466</div>
5467
5468
5469 <div id="method_uncache" class="method item">
5470 <h3 class="name"><code>uncache</code></h3>
5471
5472
5473 <span class="paren">()</span>
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490 <div class="meta">
5491
5492
5493
5494 <p>
5495
5496 Defined in
5497
5498
5499
5500
5501 <a href="../files/easeljs_display_DisplayObject.js.html#l864"><code>uncache:864</code></a>
5502
5503 </p>
5504
5505
5506
5507
5508
5509 </div>
5510
5511 <div class="description">
5512 <p>Clears the current cache. See <a href="../classes/DisplayObject.html#method_cache" class="crosslink">cache</a> for more information.</p>
5513
5514 </div>
5515
5516
5517
5518
5519
5520
5521</div>
5522
5523
5524 <div id="method_updateCache" class="method item">
5525 <h3 class="name"><code>updateCache</code></h3>
5526
5527
5528 <div class="args">
5529 <span class="paren">(</span><ul class="args-list inline commas">
5530
5531 <li class="arg">
5532
5533 <code>compositeOperation</code>
5534
5535 </li>
5536
5537 </ul><span class="paren">)</span>
5538 </div>
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555 <div class="meta">
5556
5557
5558
5559 <p>
5560
5561 Defined in
5562
5563
5564
5565
5566 <a href="../files/easeljs_display_DisplayObject.js.html#l835"><code>updateCache:835</code></a>
5567
5568 </p>
5569
5570
5571
5572
5573
5574 </div>
5575
5576 <div class="description">
5577 <p>Redraws the display object to its cache. Calling updateCache without an active cache will throw an error.
5578If compositeOperation is null the current cache will be cleared prior to drawing. Otherwise the display object
5579will be drawn over the existing cache using the specified compositeOperation.</p>
5580<p><h4>Example</h4>
5581Clear the current graphics of a cached shape, draw some new instructions, and then update the cache. The new line
5582will be drawn on top of the old one.</p>
5583<pre class="code prettyprint"><code> // Not shown: Creating the shape, and caching it.
5584 shapeInstance.clear();
5585 shapeInstance.setStrokeStyle(3).beginStroke("#ff0000").moveTo(100, 100).lineTo(200,200);
5586 shapeInstance.updateCache();</code></pre>
5587<p>In previous versions caching was handled on DisplayObject but has since been moved to <a href="../classes/BitmapCache.html" class="crosslink">BitmapCache</a>.
5588This allows for easier interaction and alternate cache methods like WebGL and <a href="../classes/StageGL.html" class="crosslink">StageGL</a>.</p>
5589
5590 </div>
5591
5592
5593 <div class="params">
5594 <h4>Parameters:</h4>
5595
5596 <ul class="params-list">
5597
5598 <li class="param">
5599
5600 <code class="param-name">compositeOperation</code>
5601 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
5602
5603
5604
5605
5606 <div class="param-description">
5607 <p>The compositeOperation to use, or null to clear the cache and redraw it.
5608<a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-globalcompositeoperation">
5609whatwg spec on compositing</a>.</p>
5610
5611 </div>
5612
5613
5614 </li>
5615
5616 </ul>
5617 </div>
5618
5619
5620
5621
5622
5623</div>
5624
5625
5626 <div id="method_updateContext" class="method item">
5627 <h3 class="name"><code>updateContext</code></h3>
5628
5629
5630 <div class="args">
5631 <span class="paren">(</span><ul class="args-list inline commas">
5632
5633 <li class="arg">
5634
5635 <code>ctx</code>
5636
5637 </li>
5638
5639 </ul><span class="paren">)</span>
5640 </div>
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657 <div class="meta">
5658
5659
5660
5661 <p>
5662
5663 Defined in
5664
5665
5666
5667
5668 <a href="../files/easeljs_display_DisplayObject.js.html#l760"><code>updateContext:760</code></a>
5669
5670 </p>
5671
5672
5673
5674
5675
5676 </div>
5677
5678 <div class="description">
5679 <p>Applies this display object's transformation, alpha, globalCompositeOperation, clipping path (mask), and shadow
5680to the specified context. This is typically called prior to <a href="../classes/DisplayObject.html#method_draw" class="crosslink">draw</a>.</p>
5681
5682 </div>
5683
5684
5685 <div class="params">
5686 <h4>Parameters:</h4>
5687
5688 <ul class="params-list">
5689
5690 <li class="param">
5691
5692 <code class="param-name">ctx</code>
5693 <span class="type">CanvasRenderingContext2D</span>
5694
5695
5696
5697
5698 <div class="param-description">
5699 <p>The canvas 2D to update.</p>
5700
5701 </div>
5702
5703
5704 </li>
5705
5706 </ul>
5707 </div>
5708
5709
5710
5711
5712
5713</div>
5714
5715
5716 <div id="method_willTrigger" class="method item inherited">
5717 <h3 class="name"><code>willTrigger</code></h3>
5718
5719
5720 <div class="args">
5721 <span class="paren">(</span><ul class="args-list inline commas">
5722
5723 <li class="arg">
5724
5725 <code>type</code>
5726
5727 </li>
5728
5729 </ul><span class="paren">)</span>
5730 </div>
5731
5732
5733
5734 <span class="returns-inline">
5735 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
5736 </span>
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751 <div class="meta">
5752
5753
5754 <p>Inherited from
5755 <a href="../classes/EventDispatcher.html#method_willTrigger">EventDispatcher</a>:
5756
5757
5758
5759 <a href="../files/createjs_events_EventDispatcher.js.html#l350"><code>willTrigger:350</code></a>
5760
5761 </p>
5762
5763
5764
5765
5766
5767 </div>
5768
5769 <div class="description">
5770 <p>Indicates whether there is at least one listener for the specified event type on this object or any of its
5771ancestors (parent, parent's parent, etc). A return value of true indicates that if a bubbling event of the
5772specified type is dispatched from this object, it will trigger at least one listener.</p>
5773<p>This is similar to <a href="../classes/EventDispatcher.html#method_hasEventListener" class="crosslink">hasEventListener</a>, but it searches the entire
5774event flow for a listener, not just this object.</p>
5775
5776 </div>
5777
5778
5779 <div class="params">
5780 <h4>Parameters:</h4>
5781
5782 <ul class="params-list">
5783
5784 <li class="param">
5785
5786 <code class="param-name">type</code>
5787 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
5788
5789
5790
5791
5792 <div class="param-description">
5793 <p>The string type of the event.</p>
5794
5795 </div>
5796
5797
5798 </li>
5799
5800 </ul>
5801 </div>
5802
5803
5804
5805 <div class="returns">
5806 <h4>Returns:</h4>
5807
5808 <div class="returns-description">
5809
5810
5811 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
5812
5813 <p>Returns <code>true</code> if there is at least one listener for the specified event.</p>
5814
5815
5816 </div>
5817 </div>
5818
5819
5820
5821</div>
5822
5823
5824 </div>
5825
5826
5827
5828 <div id="properties" class="api-class-tabpanel">
5829 <h2 class="off-left">Properties</h2>
5830
5831
5832 <div id="property__bounds" class="property item protected">
5833 <h3 class="name"><code>_bounds</code></h3>
5834 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
5835
5836
5837
5838
5839 <span class="flag protected">protected</span>
5840
5841
5842
5843
5844
5845
5846
5847
5848 <div class="meta">
5849
5850
5851
5852 <p>
5853
5854 Defined in
5855
5856
5857
5858
5859 <a href="../files/easeljs_display_DisplayObject.js.html#l443"><code>_bounds:443</code></a>
5860
5861 </p>
5862
5863
5864
5865
5866 </div>
5867
5868 <div class="description">
5869
5870 </div>
5871
5872
5873 <p><strong>Default:</strong> null</p>
5874
5875
5876
5877
5878
5879</div>
5880
5881
5882 <div id="property__cacheDataURL" class="property item protected deprecated">
5883 <h3 class="name"><code>_cacheDataURL</code></h3>
5884 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
5885
5886
5887 <span class="flag deprecated">deprecated</span>
5888
5889
5890
5891 <span class="flag protected">protected</span>
5892
5893
5894
5895
5896
5897
5898
5899
5900 <div class="meta">
5901
5902
5903
5904 <p>
5905
5906 Defined in
5907
5908
5909
5910
5911 <a href="../files/easeljs_display_DisplayObject.js.html#l418"><code>_cacheDataURL:418</code></a>
5912
5913 </p>
5914
5915
5916
5917
5918 </div>
5919
5920 <div class="description">
5921 <p>Moved to <a href="../classes/BitmapCache.html" class="crosslink">BitmapCache</a></p>
5922
5923 </div>
5924
5925
5926 <p><strong>Default:</strong> null</p>
5927
5928
5929
5930
5931
5932</div>
5933
5934
5935 <div id="property__cacheDataURLID" class="property item protected deprecated">
5936 <h3 class="name"><code>_cacheDataURLID</code></h3>
5937 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5938
5939
5940 <span class="flag deprecated">deprecated</span>
5941
5942
5943
5944 <span class="flag protected">protected</span>
5945
5946
5947
5948
5949
5950
5951
5952
5953 <div class="meta">
5954
5955
5956
5957 <p>
5958
5959 Defined in
5960
5961
5962
5963
5964 <a href="../files/easeljs_display_DisplayObject.js.html#l409"><code>_cacheDataURLID:409</code></a>
5965
5966 </p>
5967
5968
5969
5970
5971 </div>
5972
5973 <div class="description">
5974 <p>Moved to <a href="../classes/BitmapCache.html" class="crosslink">BitmapCache</a></p>
5975
5976 </div>
5977
5978
5979 <p><strong>Default:</strong> 0</p>
5980
5981
5982
5983
5984
5985</div>
5986
5987
5988 <div id="property__cacheScale" class="property item protected deprecated">
5989 <h3 class="name"><code>_cacheScale</code></h3>
5990 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
5991
5992
5993 <span class="flag deprecated">deprecated</span>
5994
5995
5996
5997 <span class="flag protected">protected</span>
5998
5999
6000
6001
6002
6003
6004
6005
6006 <div class="meta">
6007
6008
6009
6010 <p>
6011
6012 Defined in
6013
6014
6015
6016
6017 <a href="../files/easeljs_display_DisplayObject.js.html#l400"><code>_cacheScale:400</code></a>
6018
6019 </p>
6020
6021
6022
6023
6024 </div>
6025
6026 <div class="description">
6027 <p>Moved to <a href="../classes/BitmapCache.html" class="crosslink">BitmapCache</a></p>
6028
6029 </div>
6030
6031
6032 <p><strong>Default:</strong> 1</p>
6033
6034
6035
6036
6037
6038</div>
6039
6040
6041 <div id="property__captureListeners" class="property item protected inherited">
6042 <h3 class="name"><code>_captureListeners</code></h3>
6043 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
6044
6045
6046
6047
6048 <span class="flag protected">protected</span>
6049
6050
6051
6052
6053
6054
6055
6056
6057 <div class="meta">
6058
6059
6060 <p>Inherited from
6061 <a href="../classes/EventDispatcher.html#property__captureListeners">EventDispatcher</a>:
6062
6063
6064
6065 <a href="../files/createjs_events_EventDispatcher.js.html#l106"><code>_captureListeners:106</code></a>
6066
6067 </p>
6068
6069
6070
6071
6072 </div>
6073
6074 <div class="description">
6075
6076 </div>
6077
6078
6079
6080
6081
6082
6083</div>
6084
6085
6086 <div id="property__hitTestCanvas" class="property item protected">
6087 <h3 class="name"><code>_hitTestCanvas</code></h3>
6088 <span class="type">HTMLCanvasElement | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
6089
6090
6091
6092
6093 <span class="flag protected">protected</span>
6094
6095
6096
6097
6098
6099 <span class="flag static">static</span>
6100
6101
6102
6103
6104 <div class="meta">
6105
6106
6107
6108 <p>
6109
6110 Defined in
6111
6112
6113
6114
6115 <a href="../files/easeljs_display_DisplayObject.js.html#l519"><code>_hitTestCanvas:519</code></a>
6116
6117 </p>
6118
6119
6120
6121
6122 </div>
6123
6124 <div class="description">
6125
6126 </div>
6127
6128
6129
6130
6131
6132
6133</div>
6134
6135
6136 <div id="property__hitTestContext" class="property item protected">
6137 <h3 class="name"><code>_hitTestContext</code></h3>
6138 <span class="type">CanvasRenderingContext2D</span>
6139
6140
6141
6142
6143 <span class="flag protected">protected</span>
6144
6145
6146
6147
6148
6149 <span class="flag static">static</span>
6150
6151
6152
6153
6154 <div class="meta">
6155
6156
6157
6158 <p>
6159
6160 Defined in
6161
6162
6163
6164
6165 <a href="../files/easeljs_display_DisplayObject.js.html#l525"><code>_hitTestContext:525</code></a>
6166
6167 </p>
6168
6169
6170
6171
6172 </div>
6173
6174 <div class="description">
6175
6176 </div>
6177
6178
6179
6180
6181
6182
6183</div>
6184
6185
6186 <div id="property__listeners" class="property item protected inherited">
6187 <h3 class="name"><code>_listeners</code></h3>
6188 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
6189
6190
6191
6192
6193 <span class="flag protected">protected</span>
6194
6195
6196
6197
6198
6199
6200
6201
6202 <div class="meta">
6203
6204
6205 <p>Inherited from
6206 <a href="../classes/EventDispatcher.html#property__listeners">EventDispatcher</a>:
6207
6208
6209
6210 <a href="../files/createjs_events_EventDispatcher.js.html#l99"><code>_listeners:99</code></a>
6211
6212 </p>
6213
6214
6215
6216
6217 </div>
6218
6219 <div class="description">
6220
6221 </div>
6222
6223
6224
6225
6226
6227
6228</div>
6229
6230
6231 <div id="property__MOUSE_EVENTS" class="property item protected">
6232 <h3 class="name"><code>_MOUSE_EVENTS</code></h3>
6233 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a></span>
6234
6235
6236
6237
6238 <span class="flag protected">protected</span>
6239
6240
6241
6242
6243
6244 <span class="flag static">static</span>
6245
6246
6247
6248
6249 <div class="meta">
6250
6251
6252
6253 <p>
6254
6255 Defined in
6256
6257
6258
6259
6260 <a href="../files/easeljs_display_DisplayObject.js.html#l464"><code>_MOUSE_EVENTS:464</code></a>
6261
6262 </p>
6263
6264
6265
6266
6267 </div>
6268
6269 <div class="description">
6270 <p>Listing of mouse event names. Used in _hasMouseEventListener.</p>
6271
6272 </div>
6273
6274
6275
6276
6277
6278
6279</div>
6280
6281
6282 <div id="property__props" class="property item protected">
6283 <h3 class="name"><code>_props</code></h3>
6284 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
6285
6286
6287
6288
6289 <span class="flag protected">protected</span>
6290
6291
6292
6293
6294
6295
6296
6297
6298 <div class="meta">
6299
6300
6301
6302 <p>
6303
6304 Defined in
6305
6306
6307
6308
6309 <a href="../files/easeljs_display_DisplayObject.js.html#l427"><code>_props:427</code></a>
6310
6311 </p>
6312
6313
6314
6315
6316 </div>
6317
6318 <div class="description">
6319
6320 </div>
6321
6322
6323 <p><strong>Default:</strong> null</p>
6324
6325
6326
6327
6328
6329</div>
6330
6331
6332 <div id="property__rectangle" class="property item protected">
6333 <h3 class="name"><code>_rectangle</code></h3>
6334 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
6335
6336
6337
6338
6339 <span class="flag protected">protected</span>
6340
6341
6342
6343
6344
6345
6346
6347
6348 <div class="meta">
6349
6350
6351
6352 <p>
6353
6354 Defined in
6355
6356
6357
6358
6359 <a href="../files/easeljs_display_DisplayObject.js.html#l435"><code>_rectangle:435</code></a>
6360
6361 </p>
6362
6363
6364
6365
6366 </div>
6367
6368 <div class="description">
6369
6370 </div>
6371
6372
6373 <p><strong>Default:</strong> null</p>
6374
6375
6376
6377
6378
6379</div>
6380
6381
6382 <div id="property__snapToPixelEnabled" class="property item protected">
6383 <h3 class="name"><code>_snapToPixelEnabled</code></h3>
6384 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
6385
6386
6387
6388
6389 <span class="flag protected">protected</span>
6390
6391
6392
6393
6394
6395 <span class="flag static">static</span>
6396
6397
6398
6399
6400 <div class="meta">
6401
6402
6403
6404 <p>
6405
6406 Defined in
6407
6408
6409
6410
6411 <a href="../files/easeljs_display_DisplayObject.js.html#l483"><code>_snapToPixelEnabled:483</code></a>
6412
6413 </p>
6414
6415
6416
6417
6418 </div>
6419
6420 <div class="description">
6421
6422 </div>
6423
6424
6425 <p><strong>Default:</strong> false</p>
6426
6427
6428
6429
6430
6431</div>
6432
6433
6434 <div id="property__StageGL_BITMAP" class="property item protected">
6435 <h3 class="name"><code>_StageGL_BITMAP</code></h3>
6436 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
6437
6438
6439
6440
6441 <span class="flag protected">protected</span>
6442
6443
6444
6445
6446
6447 <span class="flag static">static</span>
6448
6449
6450
6451
6452 <div class="meta">
6453
6454
6455
6456 <p>
6457
6458 Defined in
6459
6460
6461
6462
6463 <a href="../files/easeljs_display_DisplayObject.js.html#l510"><code>_StageGL_BITMAP:510</code></a>
6464
6465 </p>
6466
6467
6468
6469
6470 </div>
6471
6472 <div class="description">
6473 <p>Enum like property for determining StageGL render lookup, i.e. where to expect properties.</p>
6474
6475 </div>
6476
6477
6478
6479
6480
6481
6482</div>
6483
6484
6485 <div id="property__StageGL_NONE" class="property item protected">
6486 <h3 class="name"><code>_StageGL_NONE</code></h3>
6487 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
6488
6489
6490
6491
6492 <span class="flag protected">protected</span>
6493
6494
6495
6496
6497
6498 <span class="flag static">static</span>
6499
6500
6501
6502
6503 <div class="meta">
6504
6505
6506
6507 <p>
6508
6509 Defined in
6510
6511
6512
6513
6514 <a href="../files/easeljs_display_DisplayObject.js.html#l492"><code>_StageGL_NONE:492</code></a>
6515
6516 </p>
6517
6518
6519
6520
6521 </div>
6522
6523 <div class="description">
6524 <p>Enum like property for determining StageGL render lookup, i.e. where to expect properties.</p>
6525
6526 </div>
6527
6528
6529
6530
6531
6532
6533</div>
6534
6535
6536 <div id="property__StageGL_SPRITE" class="property item protected">
6537 <h3 class="name"><code>_StageGL_SPRITE</code></h3>
6538 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
6539
6540
6541
6542
6543 <span class="flag protected">protected</span>
6544
6545
6546
6547
6548
6549 <span class="flag static">static</span>
6550
6551
6552
6553
6554 <div class="meta">
6555
6556
6557
6558 <p>
6559
6560 Defined in
6561
6562
6563
6564
6565 <a href="../files/easeljs_display_DisplayObject.js.html#l501"><code>_StageGL_SPRITE:501</code></a>
6566
6567 </p>
6568
6569
6570
6571
6572 </div>
6573
6574 <div class="description">
6575 <p>Enum like property for determining StageGL render lookup, i.e. where to expect properties.</p>
6576
6577 </div>
6578
6579
6580
6581
6582
6583
6584</div>
6585
6586
6587 <div id="property__webGLRenderStyle" class="property item protected">
6588 <h3 class="name"><code>_webGLRenderStyle</code></h3>
6589 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
6590
6591
6592
6593
6594 <span class="flag protected">protected</span>
6595
6596
6597
6598
6599
6600
6601
6602
6603 <div class="meta">
6604
6605
6606
6607 <p>
6608
6609 Defined in
6610
6611
6612
6613
6614 <a href="../files/easeljs_display_DisplayObject.js.html#l451"><code>_webGLRenderStyle:451</code></a>
6615
6616 </p>
6617
6618
6619
6620
6621 </div>
6622
6623 <div class="description">
6624 <p>Where StageGL should look for required display properties, matters only for leaf display objects. Containers
6625or cached objects won't use this property, it's for native display of terminal elements.</p>
6626
6627 </div>
6628
6629
6630 <p><strong>Default:</strong> 0</p>
6631
6632
6633
6634
6635
6636</div>
6637
6638
6639 <div id="property_alpha" class="property item">
6640 <h3 class="name"><code>alpha</code></h3>
6641 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653 <div class="meta">
6654
6655
6656
6657 <p>
6658
6659 Defined in
6660
6661
6662
6663
6664 <a href="../files/easeljs_display_DisplayObject.js.html#l144"><code>alpha:144</code></a>
6665
6666 </p>
6667
6668
6669
6670
6671 </div>
6672
6673 <div class="description">
6674 <p>The alpha (transparency) for this display object. 0 is fully transparent, 1 is fully opaque.</p>
6675
6676 </div>
6677
6678
6679 <p><strong>Default:</strong> 1</p>
6680
6681
6682
6683
6684
6685</div>
6686
6687
6688 <div id="property_bitmapCache" class="property item">
6689 <h3 class="name"><code>bitmapCache</code></h3>
6690 <span class="type"><a href="../classes/BitmapCache.html" class="crosslink">BitmapCache</a></span>
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701 <span class="flag readonly">readonly</span>
6702
6703
6704 <div class="meta">
6705
6706
6707
6708 <p>
6709
6710 Defined in
6711
6712
6713
6714
6715 <a href="../files/easeljs_display_DisplayObject.js.html#l162"><code>bitmapCache:162</code></a>
6716
6717 </p>
6718
6719
6720
6721
6722 </div>
6723
6724 <div class="description">
6725 <p>If a cache has been made, this returns the class that is managing the cacheCanvas and its properties. See <a href="../classes/BitmapCache.html" class="crosslink">BitmapCache</a>
6726for more information. Use this to control, inspect, and change the cache. In special circumstances this may be a modified or subclassed BitmapCache.</p>
6727
6728 </div>
6729
6730
6731 <p><strong>Default:</strong> null</p>
6732
6733
6734
6735
6736
6737</div>
6738
6739
6740 <div id="property_cacheCanvas" class="property item">
6741 <h3 class="name"><code>cacheCanvas</code></h3>
6742 <span class="type">HTMLCanvasElement | <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753 <span class="flag readonly">readonly</span>
6754
6755
6756 <div class="meta">
6757
6758
6759
6760 <p>
6761
6762 Defined in
6763
6764
6765
6766
6767 <a href="../files/easeljs_display_DisplayObject.js.html#l152"><code>cacheCanvas:152</code></a>
6768
6769 </p>
6770
6771
6772
6773
6774 </div>
6775
6776 <div class="description">
6777 <p>If a cache is active, this returns the canvas that holds the image of this display object. See <a href="../classes/DisplayObject.html#method_cache" class="crosslink">cache</a>
6778for more information. Use this to display the result of a cache. This will be a HTMLCanvasElement unless special cache rules have been deliberately enabled for this cache.</p>
6779
6780 </div>
6781
6782
6783 <p><strong>Default:</strong> null</p>
6784
6785
6786
6787
6788
6789</div>
6790
6791
6792 <div id="property_cacheID" class="property item deprecated">
6793 <h3 class="name"><code>cacheID</code></h3>
6794 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
6795
6796
6797 <span class="flag deprecated">deprecated</span>
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808 <div class="meta">
6809
6810
6811
6812 <p>
6813
6814 Defined in
6815
6816
6817
6818
6819 <a href="../files/easeljs_display_DisplayObject.js.html#l695"><code>cacheID:695</code></a>
6820
6821 </p>
6822
6823
6824
6825
6826 </div>
6827
6828 <div class="description">
6829 <p>Returns an ID number that uniquely identifies the current cache for this display object. This can be used to
6830determine if the cache has changed since a previous check.
6831Moved to <a href="../classes/BitmapCache.html" class="crosslink">BitmapCache</a></p>
6832
6833 </div>
6834
6835
6836 <p><strong>Default:</strong> 0</p>
6837
6838
6839
6840
6841
6842</div>
6843
6844
6845 <div id="property_compositeOperation" class="property item">
6846 <h3 class="name"><code>compositeOperation</code></h3>
6847 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859 <div class="meta">
6860
6861
6862
6863 <p>
6864
6865 Defined in
6866
6867
6868
6869
6870 <a href="../files/easeljs_display_DisplayObject.js.html#l330"><code>compositeOperation:330</code></a>
6871
6872 </p>
6873
6874
6875
6876
6877 </div>
6878
6879 <div class="description">
6880 <p>The composite operation indicates how the pixels of this display object will be composited with the elements
6881behind it. If <code>null</code>, this property is inherited from the parent container. For more information, read the
6882<a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-context-2d-globalcompositeoperation">
6883whatwg spec on compositing</a>. For a list of supported compositeOperation value, visit
6884<a href="https://drafts.fxtf.org/compositing/">the W3C draft on Compositing and Blending</a>.</p>
6885
6886 </div>
6887
6888
6889 <p><strong>Default:</strong> null</p>
6890
6891
6892
6893
6894
6895</div>
6896
6897
6898 <div id="property_cursor" class="property item">
6899 <h3 class="name"><code>cursor</code></h3>
6900 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912 <div class="meta">
6913
6914
6915
6916 <p>
6917
6918 Defined in
6919
6920
6921
6922
6923 <a href="../files/easeljs_display_DisplayObject.js.html#l388"><code>cursor:388</code></a>
6924
6925 </p>
6926
6927
6928
6929
6930 </div>
6931
6932 <div class="description">
6933 <p>A CSS cursor (ex. "pointer", "help", "text", etc) that will be displayed when the user hovers over this display
6934object. You must enable mouseover events using the <a href="../classes/Stage.html#method_enableMouseOver" class="crosslink">enableMouseOver</a> method to
6935use this property. Setting a non-null cursor on a Container will override the cursor set on its descendants.</p>
6936
6937 </div>
6938
6939
6940 <p><strong>Default:</strong> null</p>
6941
6942
6943
6944
6945
6946</div>
6947
6948
6949 <div id="property_filters" class="property item">
6950 <h3 class="name"><code>filters</code></h3>
6951 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a></span>
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963 <div class="meta">
6964
6965
6966
6967 <p>
6968
6969 Defined in
6970
6971
6972
6973
6974 <a href="../files/easeljs_display_DisplayObject.js.html#l352"><code>filters:352</code></a>
6975
6976 </p>
6977
6978
6979
6980
6981 </div>
6982
6983 <div class="description">
6984 <p>An array of Filter objects to apply to this display object. Filters are only applied / updated when Cache
6985or UpdateCache is called on the display object, and only apply to the area that is
6986cached.</p>
6987
6988 </div>
6989
6990
6991 <p><strong>Default:</strong> null</p>
6992
6993
6994
6995
6996
6997</div>
6998
6999
7000 <div id="property_hitArea" class="property item">
7001 <h3 class="name"><code>hitArea</code></h3>
7002 <span class="type"><a href="../classes/DisplayObject.html" class="crosslink">DisplayObject</a></span>
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014 <div class="meta">
7015
7016
7017
7018 <p>
7019
7020 Defined in
7021
7022
7023
7024
7025 <a href="../files/easeljs_display_DisplayObject.js.html#l371"><code>hitArea:371</code></a>
7026
7027 </p>
7028
7029
7030
7031
7032 </div>
7033
7034 <div class="description">
7035 <p>A display object that will be tested when checking mouse interactions or testing <a href="../classes/Container.html#method_getObjectsUnderPoint" class="crosslink">getObjectsUnderPoint</a>.
7036The hit area will have its transformation applied relative to this display object's coordinate space (as though
7037the hit test object were a child of this display object and relative to its regX/Y). The hitArea will be tested
7038using only its own <code>alpha</code> value regardless of the alpha value on the target display object, or the target's
7039ancestors (parents).</p>
7040<p>If set on a <a href="../classes/Container.html" class="crosslink">Container</a>, children of the Container will not receive mouse events.
7041This is similar to setting MouseChildren to false.</p>
7042<p>Note that hitArea is NOT currently used by the <code>hitTest()</code> method, nor is it supported for <a href="../classes/Stage.html" class="crosslink">Stage</a>.</p>
7043
7044 </div>
7045
7046
7047 <p><strong>Default:</strong> null</p>
7048
7049
7050
7051
7052
7053</div>
7054
7055
7056 <div id="property_id" class="property item">
7057 <h3 class="name"><code>id</code></h3>
7058 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070 <div class="meta">
7071
7072
7073
7074 <p>
7075
7076 Defined in
7077
7078
7079
7080
7081 <a href="../files/easeljs_display_DisplayObject.js.html#l172"><code>id:172</code></a>
7082
7083 </p>
7084
7085
7086
7087
7088 </div>
7089
7090 <div class="description">
7091 <p>Unique ID for this display object. Makes display objects easier for some uses.</p>
7092
7093 </div>
7094
7095
7096 <p><strong>Default:</strong> -1</p>
7097
7098
7099
7100
7101
7102</div>
7103
7104
7105 <div id="property_mask" class="property item">
7106 <h3 class="name"><code>mask</code></h3>
7107 <span class="type"><a href="../classes/Shape.html" class="crosslink">Shape</a></span>
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119 <div class="meta">
7120
7121
7122
7123 <p>
7124
7125 Defined in
7126
7127
7128
7129
7130 <a href="../files/easeljs_display_DisplayObject.js.html#l362"><code>mask:362</code></a>
7131
7132 </p>
7133
7134
7135
7136
7137 </div>
7138
7139 <div class="description">
7140 <p>A Shape instance that defines a vector mask (clipping path) for this display object. The shape's transformation
7141will be applied relative to the display object's parent coordinates (as if it were a child of the parent).</p>
7142
7143 </div>
7144
7145
7146 <p><strong>Default:</strong> null</p>
7147
7148
7149
7150
7151
7152</div>
7153
7154
7155 <div id="property_mouseEnabled" class="property item">
7156 <h3 class="name"><code>mouseEnabled</code></h3>
7157 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169 <div class="meta">
7170
7171
7172
7173 <p>
7174
7175 Defined in
7176
7177
7178
7179
7180 <a href="../files/easeljs_display_DisplayObject.js.html#l180"><code>mouseEnabled:180</code></a>
7181
7182 </p>
7183
7184
7185
7186
7187 </div>
7188
7189 <div class="description">
7190 <p>Indicates whether to include this object when running mouse interactions. Setting this to <code>false</code> for children
7191of a <a href="../classes/Container.html" class="crosslink">Container</a> will cause events on the Container to not fire when that child is
7192clicked. Setting this property to <code>false</code> does not prevent the <a href="../classes/Container.html#method_getObjectsUnderPoint" class="crosslink">getObjectsUnderPoint</a>
7193method from returning the child.</p>
7194<p><strong>Note:</strong> In EaselJS 0.7.0, the mouseEnabled property will not work properly with nested Containers. Please
7195check out the latest NEXT version in <a href="https://github.com/CreateJS/EaselJS/tree/master/lib">GitHub</a> for an updated version with this issue resolved. The fix will be
7196provided in the next release of EaselJS.</p>
7197
7198 </div>
7199
7200
7201 <p><strong>Default:</strong> true</p>
7202
7203
7204
7205
7206
7207</div>
7208
7209
7210 <div id="property_name" class="property item">
7211 <h3 class="name"><code>name</code></h3>
7212 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224 <div class="meta">
7225
7226
7227
7228 <p>
7229
7230 Defined in
7231
7232
7233
7234
7235 <a href="../files/easeljs_display_DisplayObject.js.html#l205"><code>name:205</code></a>
7236
7237 </p>
7238
7239
7240
7241
7242 </div>
7243
7244 <div class="description">
7245 <p>An optional name for this display object. Included in <a href="../classes/DisplayObject.html#method_toString" class="crosslink">toString</a> . Useful for
7246debugging.</p>
7247
7248 </div>
7249
7250
7251 <p><strong>Default:</strong> null</p>
7252
7253
7254
7255
7256
7257</div>
7258
7259
7260 <div id="property_parent" class="property item">
7261 <h3 class="name"><code>parent</code></h3>
7262 <span class="type"><a href="../classes/Container.html" class="crosslink">Container</a></span>
7263
7264
7265
7266
7267
7268
7269 <span class="flag final">final</span>
7270
7271
7272
7273
7274
7275 <span class="flag readonly">readonly</span>
7276
7277
7278 <div class="meta">
7279
7280
7281
7282 <p>
7283
7284 Defined in
7285
7286
7287
7288
7289 <a href="../files/easeljs_display_DisplayObject.js.html#l214"><code>parent:214</code></a>
7290
7291 </p>
7292
7293
7294
7295
7296 </div>
7297
7298 <div class="description">
7299 <p>A reference to the <a href="../classes/Container.html" class="crosslink">Container</a> or <a href="../classes/Stage.html" class="crosslink">Stage</a> object that
7300contains this display object, or null if it has not been added
7301to one.</p>
7302
7303 </div>
7304
7305
7306 <p><strong>Default:</strong> null</p>
7307
7308
7309
7310
7311
7312</div>
7313
7314
7315 <div id="property_regX" class="property item">
7316 <h3 class="name"><code>regX</code></h3>
7317 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329 <div class="meta">
7330
7331
7332
7333 <p>
7334
7335 Defined in
7336
7337
7338
7339
7340 <a href="../files/easeljs_display_DisplayObject.js.html#l226"><code>regX:226</code></a>
7341
7342 </p>
7343
7344
7345
7346
7347 </div>
7348
7349 <div class="description">
7350 <p>The left offset for this display object's registration point. For example, to make a 100x100px Bitmap rotate
7351around its center, you would set regX and <a href="../classes/DisplayObject.html#property_regY" class="crosslink">regY</a> to 50.
7352Cached object's registration points should be set based on pre-cache conditions, not cached size.</p>
7353
7354 </div>
7355
7356
7357 <p><strong>Default:</strong> 0</p>
7358
7359
7360
7361
7362
7363</div>
7364
7365
7366 <div id="property_regY" class="property item">
7367 <h3 class="name"><code>regY</code></h3>
7368 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380 <div class="meta">
7381
7382
7383
7384 <p>
7385
7386 Defined in
7387
7388
7389
7390
7391 <a href="../files/easeljs_display_DisplayObject.js.html#l236"><code>regY:236</code></a>
7392
7393 </p>
7394
7395
7396
7397
7398 </div>
7399
7400 <div class="description">
7401 <p>The y offset for this display object's registration point. For example, to make a 100x100px Bitmap rotate around
7402its center, you would set <a href="../classes/DisplayObject.html#property_regX" class="crosslink">regX</a> and regY to 50.
7403Cached object's registration points should be set based on pre-cache conditions, not cached size.</p>
7404
7405 </div>
7406
7407
7408 <p><strong>Default:</strong> 0</p>
7409
7410
7411
7412
7413
7414</div>
7415
7416
7417 <div id="property_rotation" class="property item">
7418 <h3 class="name"><code>rotation</code></h3>
7419 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431 <div class="meta">
7432
7433
7434
7435 <p>
7436
7437 Defined in
7438
7439
7440
7441
7442 <a href="../files/easeljs_display_DisplayObject.js.html#l246"><code>rotation:246</code></a>
7443
7444 </p>
7445
7446
7447
7448
7449 </div>
7450
7451 <div class="description">
7452 <p>The rotation in degrees for this display object.</p>
7453
7454 </div>
7455
7456
7457 <p><strong>Default:</strong> 0</p>
7458
7459
7460
7461
7462
7463</div>
7464
7465
7466 <div id="property_scaleX" class="property item">
7467 <h3 class="name"><code>scaleX</code></h3>
7468 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480 <div class="meta">
7481
7482
7483
7484 <p>
7485
7486 Defined in
7487
7488
7489
7490
7491 <a href="../files/easeljs_display_DisplayObject.js.html#l254"><code>scaleX:254</code></a>
7492
7493 </p>
7494
7495
7496
7497
7498 </div>
7499
7500 <div class="description">
7501 <p>The factor to stretch this display object horizontally. For example, setting scaleX to 2 will stretch the display
7502object to twice its nominal width. To horizontally flip an object, set the scale to a negative number.</p>
7503
7504 </div>
7505
7506
7507 <p><strong>Default:</strong> 1</p>
7508
7509
7510
7511
7512
7513</div>
7514
7515
7516 <div id="property_scaleX" class="property item">
7517 <h3 class="name"><code>scaleX</code></h3>
7518 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530 <div class="meta">
7531
7532
7533
7534 <p>
7535
7536 Defined in
7537
7538
7539
7540
7541 <a href="../files/easeljs_display_DisplayObject.js.html#l705"><code>scaleX:705</code></a>
7542
7543 </p>
7544
7545
7546
7547
7548 </div>
7549
7550 <div class="description">
7551 <p>Set both the <a href="../classes/DisplayObject.html#property_scaleX" class="crosslink">scaleX</a> and the DisplayObject/scaleY
7552property to the same value. Note that when you get the value, if the <code>scaleX</code> and <code>scaleY</code> are different values,
7553it will return only the <code>scaleX</code>.</p>
7554
7555 </div>
7556
7557
7558 <p><strong>Default:</strong> 1</p>
7559
7560
7561
7562
7563
7564</div>
7565
7566
7567 <div id="property_scaleY" class="property item">
7568 <h3 class="name"><code>scaleY</code></h3>
7569 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581 <div class="meta">
7582
7583
7584
7585 <p>
7586
7587 Defined in
7588
7589
7590
7591
7592 <a href="../files/easeljs_display_DisplayObject.js.html#l263"><code>scaleY:263</code></a>
7593
7594 </p>
7595
7596
7597
7598
7599 </div>
7600
7601 <div class="description">
7602 <p>The factor to stretch this display object vertically. For example, setting scaleY to 0.5 will stretch the display
7603object to half its nominal height. To vertically flip an object, set the scale to a negative number.</p>
7604
7605 </div>
7606
7607
7608 <p><strong>Default:</strong> 1</p>
7609
7610
7611
7612
7613
7614</div>
7615
7616
7617 <div id="property_shadow" class="property item">
7618 <h3 class="name"><code>shadow</code></h3>
7619 <span class="type"><a href="../classes/Shadow.html" class="crosslink">Shadow</a></span>
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631 <div class="meta">
7632
7633
7634
7635 <p>
7636
7637 Defined in
7638
7639
7640
7641
7642 <a href="../files/easeljs_display_DisplayObject.js.html#l288"><code>shadow:288</code></a>
7643
7644 </p>
7645
7646
7647
7648
7649 </div>
7650
7651 <div class="description">
7652 <p>A shadow object that defines the shadow to render on this display object. Set to <code>null</code> to remove a shadow. If
7653null, this property is inherited from the parent container.</p>
7654
7655 </div>
7656
7657
7658 <p><strong>Default:</strong> null</p>
7659
7660
7661
7662
7663
7664</div>
7665
7666
7667 <div id="property_skewX" class="property item">
7668 <h3 class="name"><code>skewX</code></h3>
7669 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681 <div class="meta">
7682
7683
7684
7685 <p>
7686
7687 Defined in
7688
7689
7690
7691
7692 <a href="../files/easeljs_display_DisplayObject.js.html#l272"><code>skewX:272</code></a>
7693
7694 </p>
7695
7696
7697
7698
7699 </div>
7700
7701 <div class="description">
7702 <p>The factor to skew this display object horizontally.</p>
7703
7704 </div>
7705
7706
7707 <p><strong>Default:</strong> 0</p>
7708
7709
7710
7711
7712
7713</div>
7714
7715
7716 <div id="property_skewY" class="property item">
7717 <h3 class="name"><code>skewY</code></h3>
7718 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730 <div class="meta">
7731
7732
7733
7734 <p>
7735
7736 Defined in
7737
7738
7739
7740
7741 <a href="../files/easeljs_display_DisplayObject.js.html#l280"><code>skewY:280</code></a>
7742
7743 </p>
7744
7745
7746
7747
7748 </div>
7749
7750 <div class="description">
7751 <p>The factor to skew this display object vertically.</p>
7752
7753 </div>
7754
7755
7756 <p><strong>Default:</strong> 0</p>
7757
7758
7759
7760
7761
7762</div>
7763
7764
7765 <div id="property_snapToPixel" class="property item">
7766 <h3 class="name"><code>snapToPixel</code></h3>
7767 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779 <div class="meta">
7780
7781
7782
7783 <p>
7784
7785 Defined in
7786
7787
7788
7789
7790 <a href="../files/easeljs_display_DisplayObject.js.html#l342"><code>snapToPixel:342</code></a>
7791
7792 </p>
7793
7794
7795
7796
7797 </div>
7798
7799 <div class="description">
7800 <p>Indicates whether the display object should be drawn to a whole pixel when
7801Stage/snapToPixelEnabled is true. To enable/disable snapping on whole
7802categories of display objects, set this value on the prototype (Ex. Text.prototype.snapToPixel = true).</p>
7803
7804 </div>
7805
7806
7807 <p><strong>Default:</strong> true</p>
7808
7809
7810
7811
7812
7813</div>
7814
7815
7816 <div id="property_stage" class="property item">
7817 <h3 class="name"><code>stage</code></h3>
7818 <span class="type"><a href="../classes/Stage.html" class="crosslink">Stage</a></span>
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829 <span class="flag readonly">readonly</span>
7830
7831
7832 <div class="meta">
7833
7834
7835
7836 <p>
7837
7838 Defined in
7839
7840
7841
7842
7843 <a href="../files/easeljs_display_DisplayObject.js.html#l688"><code>stage:688</code></a>
7844
7845 </p>
7846
7847
7848
7849
7850 </div>
7851
7852 <div class="description">
7853 <p>Returns the Stage instance that this display object will be rendered on, or null if it has not been added to one.</p>
7854
7855 </div>
7856
7857
7858
7859
7860
7861
7862</div>
7863
7864
7865 <div id="property_suppressCrossDomainErrors" class="property item">
7866 <h3 class="name"><code>suppressCrossDomainErrors</code></h3>
7867 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
7868
7869
7870
7871
7872
7873
7874
7875
7876 <span class="flag static">static</span>
7877
7878
7879
7880
7881 <div class="meta">
7882
7883
7884
7885 <p>
7886
7887 Defined in
7888
7889
7890
7891
7892 <a href="../files/easeljs_display_DisplayObject.js.html#l473"><code>suppressCrossDomainErrors:473</code></a>
7893
7894 </p>
7895
7896
7897
7898
7899 </div>
7900
7901 <div class="description">
7902 <p>Suppresses errors generated when using features like hitTest, mouse events, and GetObjectsUnderPoint
7903with cross domain content.</p>
7904
7905 </div>
7906
7907
7908 <p><strong>Default:</strong> false</p>
7909
7910
7911
7912
7913
7914</div>
7915
7916
7917 <div id="property_tickEnabled" class="property item">
7918 <h3 class="name"><code>tickEnabled</code></h3>
7919 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931 <div class="meta">
7932
7933
7934
7935 <p>
7936
7937 Defined in
7938
7939
7940
7941
7942 <a href="../files/easeljs_display_DisplayObject.js.html#l195"><code>tickEnabled:195</code></a>
7943
7944 </p>
7945
7946
7947
7948
7949 </div>
7950
7951 <div class="description">
7952 <p>If false, the tick will not run on this display object (or its children). This can provide some performance benefits.
7953In addition to preventing the "tick" event from being dispatched, it will also prevent tick related updates
7954on some display objects (ex. Sprite & MovieClip frame advancing, and DOMElement display properties).</p>
7955
7956 </div>
7957
7958
7959 <p><strong>Default:</strong> true</p>
7960
7961
7962
7963
7964
7965</div>
7966
7967
7968 <div id="property_transformMatrix" class="property item">
7969 <h3 class="name"><code>transformMatrix</code></h3>
7970 <span class="type"><a href="../classes/Matrix2D.html" class="crosslink">Matrix2D</a></span>
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982 <div class="meta">
7983
7984
7985
7986 <p>
7987
7988 Defined in
7989
7990
7991
7992
7993 <a href="../files/easeljs_display_DisplayObject.js.html#l321"><code>transformMatrix:321</code></a>
7994
7995 </p>
7996
7997
7998
7999
8000 </div>
8001
8002 <div class="description">
8003 <p>If set, defines the transformation for this display object, overriding all other transformation properties
8004(x, y, rotation, scale, skew).</p>
8005
8006 </div>
8007
8008
8009 <p><strong>Default:</strong> null</p>
8010
8011
8012
8013
8014
8015</div>
8016
8017
8018 <div id="property_visible" class="property item">
8019 <h3 class="name"><code>visible</code></h3>
8020 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032 <div class="meta">
8033
8034
8035
8036 <p>
8037
8038 Defined in
8039
8040
8041
8042
8043 <a href="../files/easeljs_display_DisplayObject.js.html#l297"><code>visible:297</code></a>
8044
8045 </p>
8046
8047
8048
8049
8050 </div>
8051
8052 <div class="description">
8053 <p>Indicates whether this display object should be rendered to the canvas and included when running the Stage
8054Stage/getObjectsUnderPoint method.</p>
8055
8056 </div>
8057
8058
8059 <p><strong>Default:</strong> true</p>
8060
8061
8062
8063
8064
8065</div>
8066
8067
8068 <div id="property_x" class="property item">
8069 <h3 class="name"><code>x</code></h3>
8070 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082 <div class="meta">
8083
8084
8085
8086 <p>
8087
8088 Defined in
8089
8090
8091
8092
8093 <a href="../files/easeljs_display_DisplayObject.js.html#l306"><code>x:306</code></a>
8094
8095 </p>
8096
8097
8098
8099
8100 </div>
8101
8102 <div class="description">
8103 <p>The x (horizontal) position of the display object, relative to its parent.</p>
8104
8105 </div>
8106
8107
8108 <p><strong>Default:</strong> 0</p>
8109
8110
8111
8112
8113
8114</div>
8115
8116
8117 <div id="property_y" class="property item">
8118 <h3 class="name"><code>y</code></h3>
8119 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131 <div class="meta">
8132
8133
8134
8135 <p>
8136
8137 Defined in
8138
8139
8140
8141
8142 <a href="../files/easeljs_display_DisplayObject.js.html#l314"><code>y:314</code></a>
8143
8144 </p>
8145
8146
8147
8148
8149 </div>
8150
8151 <div class="description">
8152
8153 </div>
8154
8155
8156 <p><strong>Default:</strong> 0</p>
8157
8158
8159
8160
8161
8162</div>
8163
8164
8165 </div>
8166
8167
8168
8169
8170
8171 <div id="events" class="api-class-tabpanel">
8172 <h2 class="off-left">Events</h2>
8173
8174
8175 <div id="event_added" class="events item">
8176 <h3 class="name"><code>added</code></h3>
8177 <span class="type"></span>
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187 <div class="meta">
8188
8189
8190
8191 <p>
8192
8193 Defined in
8194
8195
8196
8197
8198 <a href="../files/easeljs_display_DisplayObject.js.html#l646"><code>added:646</code></a>
8199
8200 </p>
8201
8202
8203
8204
8205 </div>
8206
8207 <div class="description">
8208 <p>Dispatched when the display object is added to a parent container.</p>
8209
8210 </div>
8211
8212
8213
8214
8215
8216</div>
8217
8218
8219 <div id="event_click" class="events item">
8220 <h3 class="name"><code>click</code></h3>
8221 <span class="type"></span>
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231 <div class="meta">
8232
8233
8234
8235 <p>
8236
8237 Defined in
8238
8239
8240
8241
8242 <a href="../files/easeljs_display_DisplayObject.js.html#l546"><code>click:546</code></a>
8243
8244 </p>
8245
8246
8247
8248
8249 <p>Available since 0.6.0</p>
8250
8251 </div>
8252
8253 <div class="description">
8254 <p>Dispatched when the user presses their left mouse button and then releases it while over the display object.
8255See the <a href="../classes/MouseEvent.html" class="crosslink">MouseEvent</a> class for a listing of event properties.</p>
8256
8257 </div>
8258
8259
8260
8261
8262
8263</div>
8264
8265
8266 <div id="event_dblclick" class="events item">
8267 <h3 class="name"><code>dblclick</code></h3>
8268 <span class="type"></span>
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278 <div class="meta">
8279
8280
8281
8282 <p>
8283
8284 Defined in
8285
8286
8287
8288
8289 <a href="../files/easeljs_display_DisplayObject.js.html#l553"><code>dblclick:553</code></a>
8290
8291 </p>
8292
8293
8294
8295
8296 <p>Available since 0.6.0</p>
8297
8298 </div>
8299
8300 <div class="description">
8301 <p>Dispatched when the user double clicks their left mouse button over this display object.
8302See the <a href="../classes/MouseEvent.html" class="crosslink">MouseEvent</a> class for a listing of event properties.</p>
8303
8304 </div>
8305
8306
8307
8308
8309
8310</div>
8311
8312
8313 <div id="event_mousedown" class="events item">
8314 <h3 class="name"><code>mousedown</code></h3>
8315 <span class="type"></span>
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325 <div class="meta">
8326
8327
8328
8329 <p>
8330
8331 Defined in
8332
8333
8334
8335
8336 <a href="../files/easeljs_display_DisplayObject.js.html#l539"><code>mousedown:539</code></a>
8337
8338 </p>
8339
8340
8341
8342
8343 <p>Available since 0.6.0</p>
8344
8345 </div>
8346
8347 <div class="description">
8348 <p>Dispatched when the user presses their left mouse button over the display object. See the
8349<a href="../classes/MouseEvent.html" class="crosslink">MouseEvent</a> class for a listing of event properties.</p>
8350
8351 </div>
8352
8353
8354
8355
8356
8357</div>
8358
8359
8360 <div id="event_mouseout" class="events item">
8361 <h3 class="name"><code>mouseout</code></h3>
8362 <span class="type"></span>
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372 <div class="meta">
8373
8374
8375
8376 <p>
8377
8378 Defined in
8379
8380
8381
8382
8383 <a href="../files/easeljs_display_DisplayObject.js.html#l568"><code>mouseout:568</code></a>
8384
8385 </p>
8386
8387
8388
8389
8390 <p>Available since 0.6.0</p>
8391
8392 </div>
8393
8394 <div class="description">
8395 <p>Dispatched when the user's mouse leaves this display object. This event must be enabled using
8396<a href="../classes/Stage.html#method_enableMouseOver" class="crosslink">enableMouseOver</a>. See also <a href="../classes/DisplayObject.html#event_rollout" class="crosslink">rollout</a>.
8397See the <a href="../classes/MouseEvent.html" class="crosslink">MouseEvent</a> class for a listing of event properties.</p>
8398
8399 </div>
8400
8401
8402
8403
8404
8405</div>
8406
8407
8408 <div id="event_mouseover" class="events item">
8409 <h3 class="name"><code>mouseover</code></h3>
8410 <span class="type"></span>
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420 <div class="meta">
8421
8422
8423
8424 <p>
8425
8426 Defined in
8427
8428
8429
8430
8431 <a href="../files/easeljs_display_DisplayObject.js.html#l560"><code>mouseover:560</code></a>
8432
8433 </p>
8434
8435
8436
8437
8438 <p>Available since 0.6.0</p>
8439
8440 </div>
8441
8442 <div class="description">
8443 <p>Dispatched when the user's mouse enters this display object. This event must be enabled using
8444<a href="../classes/Stage.html#method_enableMouseOver" class="crosslink">enableMouseOver</a>. See also <a href="../classes/DisplayObject.html#event_rollover" class="crosslink">rollover</a>.
8445See the <a href="../classes/MouseEvent.html" class="crosslink">MouseEvent</a> class for a listing of event properties.</p>
8446
8447 </div>
8448
8449
8450
8451
8452
8453</div>
8454
8455
8456 <div id="event_pressmove" class="events item">
8457 <h3 class="name"><code>pressmove</code></h3>
8458 <span class="type"></span>
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468 <div class="meta">
8469
8470
8471
8472 <p>
8473
8474 Defined in
8475
8476
8477
8478
8479 <a href="../files/easeljs_display_DisplayObject.js.html#l616"><code>pressmove:616</code></a>
8480
8481 </p>
8482
8483
8484
8485
8486 <p>Available since 0.7.0</p>
8487
8488 </div>
8489
8490 <div class="description">
8491 <p>After a <a href="../classes/DisplayObject.html#event_mousedown" class="crosslink">mousedown</a> occurs on a display object, a pressmove
8492event will be generated on that object whenever the mouse moves until the mouse press is released. This can be
8493useful for dragging and similar operations.</p>
8494<p><strong>Please note</strong> that if the initial mouse target from a <code>mousedown</code> event is removed from the stage after being pressed
8495(e.g. during a <code>pressmove</code> event), a <code>pressmove</code> event is still generated. However since it is no longer in the
8496display list, the event can not bubble. This means that previous ancestors (parent containers) will not receive
8497the event, and therefore can not re-dispatch it. If you intend to listen for <code><a href="../classes/DisplayObject.html#event_pressup" class="crosslink">pressup</a></code>
8498or <code>pressmove</code> on a dynamic object (such as a <a href="../classes/MovieClip.html" class="crosslink">MovieClip</a> or <a href="../classes/Container.html" class="crosslink">Container</a>),
8499then ensure you set <a href="../classes/Container.html#property_mouseChildren" class="crosslink">mouseChildren</a> to <code>false</code>.</p>
8500
8501 </div>
8502
8503
8504
8505
8506
8507</div>
8508
8509
8510 <div id="event_pressup" class="events item">
8511 <h3 class="name"><code>pressup</code></h3>
8512 <span class="type"></span>
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522 <div class="meta">
8523
8524
8525
8526 <p>
8527
8528 Defined in
8529
8530
8531
8532
8533 <a href="../files/easeljs_display_DisplayObject.js.html#l631"><code>pressup:631</code></a>
8534
8535 </p>
8536
8537
8538
8539
8540 <p>Available since 0.7.0</p>
8541
8542 </div>
8543
8544 <div class="description">
8545 <p>After a <a href="../classes/DisplayObject.html#event_mousedown" class="crosslink">mousedown</a> occurs on a display object, a pressup event
8546will be generated on that object when that mouse press is released. This can be useful for dragging and similar
8547operations.</p>
8548<p><strong>Please note</strong> that if the initial mouse target from a <code>mousedown</code> event is removed from the stage after being pressed
8549(e.g. during a <code>pressmove</code> event), a <code>pressup</code> event is still generated. However since it is no longer in the
8550display list, the event can not bubble. This means that previous ancestors (parent containers) will not receive
8551the event, and therefore can not re-dispatch it. If you intend to listen for <code><a href="../classes/DisplayObject.html#event_pressmove" class="crosslink">pressmove</a></code>
8552or <code>pressup</code> on a dynamic object (such as a <a href="../classes/MovieClip.html" class="crosslink">MovieClip</a> or <a href="../classes/Container.html" class="crosslink">Container</a>),
8553then ensure you set <a href="../classes/Container.html#property_mouseChildren" class="crosslink">mouseChildren</a> to <code>false</code>.</p>
8554
8555 </div>
8556
8557
8558
8559
8560
8561</div>
8562
8563
8564 <div id="event_removed" class="events item">
8565 <h3 class="name"><code>removed</code></h3>
8566 <span class="type"></span>
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576 <div class="meta">
8577
8578
8579
8580 <p>
8581
8582 Defined in
8583
8584
8585
8586
8587 <a href="../files/easeljs_display_DisplayObject.js.html#l651"><code>removed:651</code></a>
8588
8589 </p>
8590
8591
8592
8593
8594 </div>
8595
8596 <div class="description">
8597 <p>Dispatched when the display object is removed from its parent container.</p>
8598
8599 </div>
8600
8601
8602
8603
8604
8605</div>
8606
8607
8608 <div id="event_rollout" class="events item">
8609 <h3 class="name"><code>rollout</code></h3>
8610 <span class="type"></span>
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620 <div class="meta">
8621
8622
8623
8624 <p>
8625
8626 Defined in
8627
8628
8629
8630
8631 <a href="../files/easeljs_display_DisplayObject.js.html#l596"><code>rollout:596</code></a>
8632
8633 </p>
8634
8635
8636
8637
8638 <p>Available since 0.7.0</p>
8639
8640 </div>
8641
8642 <div class="description">
8643 <p>This event is similar to <a href="../classes/DisplayObject.html#event_mouseout" class="crosslink">mouseout</a>, with the following
8644differences: it does not bubble, and it considers <a href="../classes/Container.html" class="crosslink">Container</a> instances as an
8645aggregate of their content.</p>
8646<p>For example, myContainer contains two overlapping children: shapeA and shapeB. The user moves their mouse over
8647shapeA, then directly on to shapeB, then off both. With a listener for Mouseout:event
8648on myContainer, two events would be received, each targeting a child element:<OL></p>
8649<p><LI>when the mouse leaves shapeA (target=shapeA)</LI></p>
8650<p><LI>when the mouse leaves shapeB (target=shapeB)</LI>
8651</OL>
8652However, with a listener for "rollout" instead, only a single event is received when the mouse leaves
8653the aggregate myContainer content (target=myContainer).</p>
8654<p>This event must be enabled using <a href="../classes/Stage.html#method_enableMouseOver" class="crosslink">enableMouseOver</a>.
8655See the <a href="../classes/MouseEvent.html" class="crosslink">MouseEvent</a> class for a listing of event properties.</p>
8656
8657 </div>
8658
8659
8660
8661
8662
8663</div>
8664
8665
8666 <div id="event_rollover" class="events item">
8667 <h3 class="name"><code>rollover</code></h3>
8668 <span class="type"></span>
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678 <div class="meta">
8679
8680
8681
8682 <p>
8683
8684 Defined in
8685
8686
8687
8688
8689 <a href="../files/easeljs_display_DisplayObject.js.html#l576"><code>rollover:576</code></a>
8690
8691 </p>
8692
8693
8694
8695
8696 <p>Available since 0.7.0</p>
8697
8698 </div>
8699
8700 <div class="description">
8701 <p>This event is similar to <a href="../classes/DisplayObject.html#event_mouseover" class="crosslink">mouseover</a>, with the following
8702differences: it does not bubble, and it considers <a href="../classes/Container.html" class="crosslink">Container</a> instances as an
8703aggregate of their content.</p>
8704<p>For example, myContainer contains two overlapping children: shapeA and shapeB. The user moves their mouse over
8705shapeA and then directly on to shapeB. With a listener for Mouseover:event on
8706myContainer, two events would be received, each targeting a child element:<OL></p>
8707<p><LI>when the mouse enters shapeA (target=shapeA)</LI></p>
8708<p><LI>when the mouse enters shapeB (target=shapeB)</LI>
8709</OL>
8710However, with a listener for "rollover" instead, only a single event is received when the mouse first enters
8711the aggregate myContainer content (target=myContainer).</p>
8712<p>This event must be enabled using <a href="../classes/Stage.html#method_enableMouseOver" class="crosslink">enableMouseOver</a>.
8713See the <a href="../classes/MouseEvent.html" class="crosslink">MouseEvent</a> class for a listing of event properties.</p>
8714
8715 </div>
8716
8717
8718
8719
8720
8721</div>
8722
8723
8724 <div id="event_tick" class="events item">
8725 <h3 class="name"><code>tick</code></h3>
8726 <span class="type"></span>
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736 <div class="meta">
8737
8738
8739
8740 <p>
8741
8742 Defined in
8743
8744
8745
8746
8747 <a href="../files/easeljs_display_DisplayObject.js.html#l656"><code>tick:656</code></a>
8748
8749 </p>
8750
8751
8752
8753
8754 <p>Available since 0.6.0</p>
8755
8756 </div>
8757
8758 <div class="description">
8759 <p>Dispatched on each display object on a stage whenever the stage updates. This occurs immediately before the
8760rendering (draw) pass. When <a href="../classes/Stage.html#method_update" class="crosslink">update</a> is called, first all display objects on
8761the stage dispatch the tick event, then all of the display objects are drawn to stage. Children will have their
8762Tick:event event dispatched in order of their depth prior to the event being
8763dispatched on their parent.</p>
8764
8765 </div>
8766
8767
8768 <div class="params">
8769 <h4>Event Payload:</h4>
8770
8771 <ul class="params-list">
8772
8773 <li class="param">
8774
8775 <code class="param-name">target</code>
8776 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object" class="crosslink external" target="_blank">Object</a></span>
8777
8778
8779
8780
8781 <div class="param-description">
8782 <p>The object that dispatched the event.</p>
8783
8784 </div>
8785
8786
8787 </li>
8788
8789 <li class="param">
8790
8791 <code class="param-name">type</code>
8792 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
8793
8794
8795
8796
8797 <div class="param-description">
8798 <p>The event type.</p>
8799
8800 </div>
8801
8802
8803 </li>
8804
8805 <li class="param">
8806
8807 <code class="param-name">params</code>
8808 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array" class="crosslink external" target="_blank">Array</a></span>
8809
8810
8811
8812
8813 <div class="param-description">
8814 <p>An array containing any arguments that were passed to the Stage.update() method. For
8815 example if you called stage.update("hello"), then the params would be ["hello"].</p>
8816
8817 </div>
8818
8819
8820 </li>
8821
8822 </ul>
8823 </div>
8824
8825
8826
8827
8828</div>
8829
8830
8831 </div>
8832
8833 </div>
8834</div>
8835
8836 </div>
8837 </div>
8838 </div>
8839 </div>
8840 </div>
8841</div>
8842<script src="../assets/vendor/prettify/prettify-min.js"></script>
8843<script>prettyPrint();</script>
8844<script src="../assets/js/yui-prettify.js"></script>
8845<script src="../assets/../api.js"></script>
8846<script src="../assets/js/api-filter.js"></script>
8847<script src="../assets/js/api-list.js"></script>
8848<script src="../assets/js/api-search.js"></script>
8849<script src="../assets/js/apidocs.js"></script>
8850</body>
8851</html>