@awayjs/scene 0.13.324 → 0.13.325

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/.eslintrc +100 -100
  2. package/README.md +61 -61
  3. package/bundle/awayjs-scene.umd.js +1 -1
  4. package/bundle/awayjs-scene.umd.js.map +1 -1
  5. package/copyVersionToIndex.js +23 -23
  6. package/dist/index.d.ts +76 -76
  7. package/dist/index.js +67 -67
  8. package/dist/lib/Scene.d.ts +85 -85
  9. package/dist/lib/Scene.js +285 -285
  10. package/dist/lib/Settings.d.ts +16 -16
  11. package/dist/lib/Settings.js +60 -60
  12. package/dist/lib/adapters/IDisplayObjectAdapter.d.ts +13 -13
  13. package/dist/lib/adapters/IDisplayObjectAdapter.js +1 -1
  14. package/dist/lib/adapters/IFilter.d.ts +24 -24
  15. package/dist/lib/adapters/IFilter.js +1 -1
  16. package/dist/lib/adapters/IMovieClipAdapter.d.ts +15 -15
  17. package/dist/lib/adapters/IMovieClipAdapter.js +1 -1
  18. package/dist/lib/adapters/ITextfieldAdapter.d.ts +4 -4
  19. package/dist/lib/adapters/ITextfieldAdapter.js +1 -1
  20. package/dist/lib/base/IBitmapDrawable.d.ts +11 -11
  21. package/dist/lib/base/IBitmapDrawable.js +1 -1
  22. package/dist/lib/base/IFrameLabel.d.ts +4 -4
  23. package/dist/lib/base/IFrameLabel.js +1 -1
  24. package/dist/lib/base/IFrameScript.d.ts +5 -5
  25. package/dist/lib/base/IFrameScript.js +1 -1
  26. package/dist/lib/base/MouseButtons.d.ts +26 -26
  27. package/dist/lib/base/MouseButtons.js +1 -1
  28. package/dist/lib/base/Timeline.d.ts +147 -147
  29. package/dist/lib/base/Timeline.js +525 -525
  30. package/dist/lib/base/TimelineActionType.d.ts +18 -18
  31. package/dist/lib/base/TimelineActionType.js +1 -1
  32. package/dist/lib/controllers/ControllerBase.d.ts +14 -14
  33. package/dist/lib/controllers/ControllerBase.js +60 -60
  34. package/dist/lib/controllers/FirstPersonController.d.ts +78 -78
  35. package/dist/lib/controllers/FirstPersonController.js +228 -228
  36. package/dist/lib/controllers/FollowController.d.ts +12 -12
  37. package/dist/lib/controllers/FollowController.js +27 -27
  38. package/dist/lib/controllers/HoverController.d.ts +105 -105
  39. package/dist/lib/controllers/HoverController.js +302 -302
  40. package/dist/lib/controllers/LookAtController.d.ts +14 -14
  41. package/dist/lib/controllers/LookAtController.js +68 -68
  42. package/dist/lib/controllers/SpringController.d.ts +38 -38
  43. package/dist/lib/controllers/SpringController.js +59 -59
  44. package/dist/lib/display/Billboard.d.ts +132 -132
  45. package/dist/lib/display/Billboard.js +397 -397
  46. package/dist/lib/display/Camera.d.ts +31 -31
  47. package/dist/lib/display/Camera.js +72 -72
  48. package/dist/lib/display/DisplayObject.d.ts +921 -921
  49. package/dist/lib/display/DisplayObject.js +1595 -1595
  50. package/dist/lib/display/DisplayObjectContainer.d.ts +325 -325
  51. package/dist/lib/display/DisplayObjectContainer.js +486 -486
  52. package/dist/lib/display/LineSegment.d.ts +69 -69
  53. package/dist/lib/display/LineSegment.js +203 -203
  54. package/dist/lib/display/LoaderContainer.d.ts +504 -504
  55. package/dist/lib/display/LoaderContainer.js +603 -603
  56. package/dist/lib/display/MorphSprite.d.ts +20 -20
  57. package/dist/lib/display/MorphSprite.js +246 -246
  58. package/dist/lib/display/MovieClip.d.ts +149 -149
  59. package/dist/lib/display/MovieClip.js +733 -733
  60. package/dist/lib/display/SimpleButton.d.ts +158 -158
  61. package/dist/lib/display/SimpleButton.js +228 -228
  62. package/dist/lib/display/Skybox.d.ts +144 -144
  63. package/dist/lib/display/Skybox.js +288 -288
  64. package/dist/lib/display/Sprite.d.ts +65 -65
  65. package/dist/lib/display/Sprite.js +134 -134
  66. package/dist/lib/display/TextField.d.ts +1104 -1104
  67. package/dist/lib/display/TextField.d.ts.map +1 -1
  68. package/dist/lib/display/TextField.js +3019 -3018
  69. package/dist/lib/display/TextSprite.d.ts +16 -16
  70. package/dist/lib/display/TextSprite.js +36 -36
  71. package/dist/lib/elements/SkyboxElements.d.ts +29 -29
  72. package/dist/lib/elements/SkyboxElements.js +127 -127
  73. package/dist/lib/errors/CastError.d.ts +4 -4
  74. package/dist/lib/errors/CastError.js +10 -10
  75. package/dist/lib/events/CameraEvent.d.ts +16 -16
  76. package/dist/lib/events/CameraEvent.js +30 -30
  77. package/dist/lib/events/FocusEvent.d.ts +42 -42
  78. package/dist/lib/events/FocusEvent.js +43 -43
  79. package/dist/lib/events/KeyboardEvent.d.ts +21 -21
  80. package/dist/lib/events/KeyboardEvent.js +43 -43
  81. package/dist/lib/events/MouseEvent.d.ts +91 -91
  82. package/dist/lib/events/MouseEvent.js +122 -122
  83. package/dist/lib/events/PointerEvent.d.ts +93 -93
  84. package/dist/lib/events/PointerEvent.js +73 -73
  85. package/dist/lib/events/ResizeEvent.d.ts +15 -15
  86. package/dist/lib/events/ResizeEvent.js +38 -38
  87. package/dist/lib/events/TextfieldEvent.d.ts +19 -19
  88. package/dist/lib/events/TextfieldEvent.js +28 -28
  89. package/dist/lib/events/TouchEvent.d.ts +54 -54
  90. package/dist/lib/events/TouchEvent.js +89 -89
  91. package/dist/lib/factories/DefaultSceneGraphFactory.d.ts +27 -27
  92. package/dist/lib/factories/DefaultSceneGraphFactory.js +55 -55
  93. package/dist/lib/factories/ISceneGraphFactory.d.ts +20 -20
  94. package/dist/lib/factories/ISceneGraphFactory.js +1 -1
  95. package/dist/lib/image/SceneImage2D.d.ts +220 -220
  96. package/dist/lib/image/SceneImage2D.js +610 -610
  97. package/dist/lib/managers/DefaultFontManager.d.ts +14 -14
  98. package/dist/lib/managers/DefaultFontManager.js +101 -101
  99. package/dist/lib/managers/DeviceFontManager.d.ts +8 -8
  100. package/dist/lib/managers/DeviceFontManager.js +44 -44
  101. package/dist/lib/managers/FrameScriptManager.d.ts +37 -37
  102. package/dist/lib/managers/FrameScriptManager.js +386 -386
  103. package/dist/lib/managers/IInputRecorder.d.ts +3 -3
  104. package/dist/lib/managers/IInputRecorder.js +1 -1
  105. package/dist/lib/managers/MouseManager.d.ts +74 -74
  106. package/dist/lib/managers/MouseManager.js +803 -803
  107. package/dist/lib/prefabs/PrefabBase.d.ts +19 -19
  108. package/dist/lib/prefabs/PrefabBase.js +42 -42
  109. package/dist/lib/prefabs/PrimitiveCapsulePrefab.d.ts +56 -56
  110. package/dist/lib/prefabs/PrimitiveCapsulePrefab.js +269 -269
  111. package/dist/lib/prefabs/PrimitiveConePrefab.d.ts +21 -21
  112. package/dist/lib/prefabs/PrimitiveConePrefab.js +43 -43
  113. package/dist/lib/prefabs/PrimitiveCubePrefab.d.ts +74 -74
  114. package/dist/lib/prefabs/PrimitiveCubePrefab.js +545 -545
  115. package/dist/lib/prefabs/PrimitiveCylinderPrefab.d.ts +79 -79
  116. package/dist/lib/prefabs/PrimitiveCylinderPrefab.js +584 -584
  117. package/dist/lib/prefabs/PrimitivePlanePrefab.d.ts +65 -65
  118. package/dist/lib/prefabs/PrimitivePlanePrefab.js +300 -300
  119. package/dist/lib/prefabs/PrimitivePolygonPrefab.d.ts +29 -29
  120. package/dist/lib/prefabs/PrimitivePolygonPrefab.js +64 -64
  121. package/dist/lib/prefabs/PrimitivePrefabBase.d.ts +67 -67
  122. package/dist/lib/prefabs/PrimitivePrefabBase.js +158 -158
  123. package/dist/lib/prefabs/PrimitiveSpherePrefab.d.ts +48 -48
  124. package/dist/lib/prefabs/PrimitiveSpherePrefab.js +294 -294
  125. package/dist/lib/prefabs/PrimitiveTorusPrefab.d.ts +55 -55
  126. package/dist/lib/prefabs/PrimitiveTorusPrefab.js +260 -260
  127. package/dist/lib/text/AntiAliasType.d.ts +24 -24
  128. package/dist/lib/text/AntiAliasType.js +28 -28
  129. package/dist/lib/text/BitmapFontChar.d.ts +39 -39
  130. package/dist/lib/text/BitmapFontChar.js +42 -42
  131. package/dist/lib/text/BitmapFontTable.d.ts +73 -73
  132. package/dist/lib/text/BitmapFontTable.js +183 -183
  133. package/dist/lib/text/FNTGenerator.d.ts +10 -10
  134. package/dist/lib/text/FNTGenerator.js +74 -74
  135. package/dist/lib/text/FNTGeneratorCanvas.d.ts +22 -22
  136. package/dist/lib/text/FNTGeneratorCanvas.js +211 -211
  137. package/dist/lib/text/FNTGeneratrorBase.d.ts +7 -7
  138. package/dist/lib/text/FNTGeneratrorBase.js +7 -7
  139. package/dist/lib/text/Font.d.ts +38 -38
  140. package/dist/lib/text/Font.js +109 -109
  141. package/dist/lib/text/FontLookUpMode.d.ts +5 -5
  142. package/dist/lib/text/FontLookUpMode.js +7 -7
  143. package/dist/lib/text/FontStyleName.d.ts +6 -6
  144. package/dist/lib/text/FontStyleName.js +7 -7
  145. package/dist/lib/text/GridFitType.d.ts +31 -31
  146. package/dist/lib/text/GridFitType.js +35 -35
  147. package/dist/lib/text/HTMLTextProcessor.d.ts +8 -8
  148. package/dist/lib/text/HTMLTextProcessor.js +426 -426
  149. package/dist/lib/text/IFontTable.d.ts +16 -16
  150. package/dist/lib/text/IFontTable.js +1 -1
  151. package/dist/lib/text/TesselatedFontChar.d.ts +58 -58
  152. package/dist/lib/text/TesselatedFontChar.js +66 -66
  153. package/dist/lib/text/TesselatedFontTable.d.ts +88 -88
  154. package/dist/lib/text/TesselatedFontTable.js +963 -963
  155. package/dist/lib/text/TextFieldAutoSize.d.ts +28 -28
  156. package/dist/lib/text/TextFieldAutoSize.js +32 -32
  157. package/dist/lib/text/TextFieldType.d.ts +20 -20
  158. package/dist/lib/text/TextFieldType.js +24 -24
  159. package/dist/lib/text/TextFormat.d.ts +273 -273
  160. package/dist/lib/text/TextFormat.js +449 -449
  161. package/dist/lib/text/TextFormatAlign.d.ts +26 -26
  162. package/dist/lib/text/TextFormatAlign.js +30 -30
  163. package/dist/lib/text/TextInteractionMode.d.ts +21 -21
  164. package/dist/lib/text/TextInteractionMode.js +25 -25
  165. package/dist/lib/text/TextLineMetrics.d.ts +61 -61
  166. package/dist/lib/text/TextLineMetrics.js +42 -42
  167. package/dist/lib/text/TextShape.d.ts +22 -22
  168. package/dist/lib/text/TextShape.js +75 -75
  169. package/dist/lib/tools/Merge.d.ts +81 -81
  170. package/dist/lib/tools/Merge.js +266 -266
  171. package/dist/lib/utils/Cast.d.ts +20 -20
  172. package/dist/lib/utils/Cast.js +271 -271
  173. package/index.ts +92 -92
  174. package/lib/Scene.ts +339 -339
  175. package/lib/Settings.ts +83 -83
  176. package/lib/adapters/IDisplayObjectAdapter.ts +23 -23
  177. package/lib/adapters/IFilter.ts +25 -25
  178. package/lib/adapters/IMovieClipAdapter.ts +26 -26
  179. package/lib/adapters/ITextfieldAdapter.ts +6 -6
  180. package/lib/base/IBitmapDrawable.ts +13 -13
  181. package/lib/base/IFrameLabel.ts +3 -3
  182. package/lib/base/IFrameScript.ts +4 -4
  183. package/lib/base/MouseButtons.ts +31 -31
  184. package/lib/base/Timeline.ts +715 -715
  185. package/lib/base/TimelineActionType.ts +18 -18
  186. package/lib/controllers/ControllerBase.ts +66 -66
  187. package/lib/controllers/FirstPersonController.ts +241 -241
  188. package/lib/controllers/FollowController.ts +22 -22
  189. package/lib/controllers/HoverController.ts +304 -304
  190. package/lib/controllers/LookAtController.ts +75 -75
  191. package/lib/controllers/SpringController.ts +91 -91
  192. package/lib/display/Billboard.ts +468 -468
  193. package/lib/display/Camera.ts +75 -75
  194. package/lib/display/DisplayObject.ts +1829 -1829
  195. package/lib/display/DisplayObjectContainer.ts +546 -546
  196. package/lib/display/LineSegment.ts +229 -229
  197. package/lib/display/LoaderContainer.ts +651 -651
  198. package/lib/display/MorphSprite.ts +339 -339
  199. package/lib/display/MovieClip.ts +870 -870
  200. package/lib/display/SimpleButton.ts +224 -224
  201. package/lib/display/Skybox.ts +352 -352
  202. package/lib/display/Sprite.ts +154 -154
  203. package/lib/display/TextField.ts +3876 -3875
  204. package/lib/display/TextSprite.ts +34 -34
  205. package/lib/elements/SkyboxElements.ts +141 -141
  206. package/lib/errors/CastError.ts +6 -6
  207. package/lib/events/CameraEvent.ts +29 -29
  208. package/lib/events/FocusEvent.ts +69 -69
  209. package/lib/events/KeyboardEvent.ts +40 -40
  210. package/lib/events/MouseEvent.ts +144 -144
  211. package/lib/events/PointerEvent.ts +145 -145
  212. package/lib/events/ResizeEvent.ts +31 -31
  213. package/lib/events/TextfieldEvent.ts +28 -28
  214. package/lib/events/TouchEvent.ts +103 -103
  215. package/lib/factories/DefaultSceneGraphFactory.ts +58 -58
  216. package/lib/factories/ISceneGraphFactory.ts +28 -28
  217. package/lib/image/SceneImage2D.ts +912 -912
  218. package/lib/managers/DefaultFontManager.ts +124 -124
  219. package/lib/managers/DeviceFontManager.ts +55 -55
  220. package/lib/managers/FrameScriptManager.ts +440 -440
  221. package/lib/managers/IInputRecorder.ts +2 -2
  222. package/lib/managers/MouseManager.ts +942 -942
  223. package/lib/prefabs/PrefabBase.ts +47 -47
  224. package/lib/prefabs/PrimitiveCapsulePrefab.ts +286 -286
  225. package/lib/prefabs/PrimitiveConePrefab.ts +37 -37
  226. package/lib/prefabs/PrimitiveCubePrefab.ts +630 -630
  227. package/lib/prefabs/PrimitiveCylinderPrefab.ts +657 -657
  228. package/lib/prefabs/PrimitivePlanePrefab.ts +352 -352
  229. package/lib/prefabs/PrimitivePolygonPrefab.ts +53 -53
  230. package/lib/prefabs/PrimitivePrefabBase.ts +177 -177
  231. package/lib/prefabs/PrimitiveSpherePrefab.ts +336 -336
  232. package/lib/prefabs/PrimitiveTorusPrefab.ts +282 -282
  233. package/lib/text/AntiAliasType.ts +24 -24
  234. package/lib/text/BitmapFontChar.ts +53 -53
  235. package/lib/text/BitmapFontTable.ts +213 -213
  236. package/lib/text/FNTGenerator.ts +100 -100
  237. package/lib/text/FNTGeneratorCanvas.ts +292 -292
  238. package/lib/text/FNTGeneratrorBase.ts +10 -10
  239. package/lib/text/Font.ts +114 -114
  240. package/lib/text/FontLookUpMode.ts +5 -5
  241. package/lib/text/FontStyleName.ts +6 -6
  242. package/lib/text/GridFitType.ts +32 -32
  243. package/lib/text/HTMLTextProcessor.ts +421 -421
  244. package/lib/text/IFontTable.ts +17 -17
  245. package/lib/text/TesselatedFontChar.ts +80 -80
  246. package/lib/text/TesselatedFontTable.ts +1181 -1181
  247. package/lib/text/TextFieldAutoSize.ts +30 -30
  248. package/lib/text/TextFieldType.ts +21 -21
  249. package/lib/text/TextFormat.ts +603 -603
  250. package/lib/text/TextFormatAlign.ts +28 -28
  251. package/lib/text/TextInteractionMode.ts +21 -21
  252. package/lib/text/TextLineMetrics.ts +74 -74
  253. package/lib/text/TextShape.ts +91 -91
  254. package/lib/tools/Merge.ts +311 -311
  255. package/lib/utils/Cast.ts +304 -304
  256. package/package.json +74 -74
  257. package/rollup.config.js +33 -33
  258. package/scripts/build.sh +2 -2
  259. package/scripts/gendocs.sh +14 -14
  260. package/scripts/genexamples.sh +14 -14
  261. package/scripts/genfull.sh +14 -14
  262. package/system.config.js +51 -51
  263. package/tsconfig.json +18 -18
@@ -1,505 +1,505 @@
1
- import { Loader, LoaderContext, URLRequest, ParserBase, EventBase } from '@awayjs/core';
2
- import { DisplayObjectContainer } from './DisplayObjectContainer';
3
- import { DisplayObject } from './DisplayObject';
4
- /**
5
- * The LoaderContainer class is used to load SWF files or image(JPG, PNG, or GIF)
6
- * files. Use the <code>load()</code> method to initiate loading. The loaded
7
- * display object is added as a child of the LoaderContainer object.
8
- *
9
- * <p>Use the URLLoader class to load text or binary data.</p>
10
- *
11
- * <p>The LoaderContainer class overrides the following methods that it inherits,
12
- * because a LoaderContainer object can only have one child display object - the
13
- * display object that it loads. Calling the following methods throws an
14
- * exception: <code>addChild()</code>, <code>addChildAt()</code>,
15
- * <code>removeChild()</code>, <code>removeChildAt()</code>, and
16
- * <code>setChildIndex()</code>. To remove a loaded display object, you must
17
- * remove the <i>LoaderContainer</i> object from its parent DisplayObjectContainer
18
- * child array. </p>
19
- *
20
- * <p><b>Note:</b> The ActionScript 2.0 MovieClipLoader and LoadVars classes
21
- * are not used in ActionScript 3.0. The LoaderContainer and URLLoader classes replace
22
- * them.</p>
23
- *
24
- * <p>When you use the LoaderContainer class, consider the Flash Player and Adobe AIR
25
- * security model: </p>
26
- *
27
- * <ul>
28
- * <li>You can load content from any accessible source. </li>
29
- * <li>Loading is not allowed if the calling SWF file is in a network
30
- * sandbox and the file to be loaded is local. </li>
31
- * <li>If the loaded content is a SWF file written with ActionScript 3.0, it
32
- * cannot be cross-scripted by a SWF file in another security sandbox unless
33
- * that cross-scripting arrangement was approved through a call to the
34
- * <code>System.allowDomain()</code> or the
35
- * <code>System.allowInsecureDomain()</code> method in the loaded content
36
- * file.</li>
37
- * <li>If the loaded content is an AVM1 SWF file(written using ActionScript
38
- * 1.0 or 2.0), it cannot be cross-scripted by an AVM2 SWF file(written using
39
- * ActionScript 3.0). However, you can communicate between the two SWF files
40
- * by using the LocalConnection class.</li>
41
- * <li>If the loaded content is an image, its data cannot be accessed by a
42
- * SWF file outside of the security sandbox, unless the domain of that SWF
43
- * file was included in a URL policy file at the origin domain of the
44
- * image.</li>
45
- * <li>Movie clips in the local-with-file-system sandbox cannot script movie
46
- * clips in the local-with-networking sandbox, and the reverse is also
47
- * prevented. </li>
48
- * <li>You cannot connect to commonly reserved ports. For a complete list of
49
- * blocked ports, see "Restricting Networking APIs" in the <i>ActionScript 3.0
50
- * Developer's Guide</i>. </li>
51
- * </ul>
52
- *
53
- * <p>However, in AIR, content in the <code>application</code> security
54
- * sandbox(content installed with the AIR application) are not restricted by
55
- * these security limitations.</p>
56
- *
57
- * <p>For more information related to security, see the Flash Player Developer
58
- * Center Topic: <a href="http://www.adobe.com/go/devnet_security_en"
59
- * scope="external">Security</a>.</p>
60
- *
61
- * <p>When loading a SWF file from an untrusted source(such as a domain other
62
- * than that of the LoaderContainer object's root SWF file), you may want to define a
63
- * mask for the LoaderContainer object, to prevent the loaded content(which is a child
64
- * of the LoaderContainer object) from drawing to portions of the Stage outside of that
65
- * mask, as shown in the following code:</p>
66
- */
67
- export declare class LoaderContainer extends DisplayObjectContainer {
68
- /**
69
- * Dispatched when any asset finishes parsing. Also see specific events for each
70
- * individual asset type (sprites, materials et c.)
71
- *
72
- * @eventType AssetEvent
73
- */
74
- /**
75
- * Dispatched when a full resource (including dependencies) finishes loading.
76
- *
77
- * @eventType LoaderEvent
78
- */
79
- private _contentLoader;
80
- private _useAssetLib;
81
- private _assetLibId;
82
- private _onLoaderStartDelegate;
83
- private _onLoadProgressDelegate;
84
- private _onLoadCompleteDelegate;
85
- private _onAssetCompleteDelegate;
86
- private _onLoaderCompleteDelegate;
87
- private _onLoadErrorDelegate;
88
- private _onParseErrorDelegate;
89
- private _errorDelegateSelector;
90
- private _content;
91
- /**
92
- * Contains the root display object of the SWF file or image(JPG, PNG, or
93
- * GIF) file that was loaded by using the <code>load()</code> or
94
- * <code>loadBytes()</code> methods.
95
- *
96
- * @throws SecurityError The loaded SWF file or image file belongs to a
97
- * security sandbox to which you do not have access.
98
- * For a loaded SWF file, you can avoid this situation
99
- * by having the file call the
100
- * <code>Security.allowDomain()</code> method or by
101
- * having the loading file specify a
102
- * <code>loaderContext</code> parameter with its
103
- * <code>securityDomain</code> property set to
104
- * <code>SecurityDomain.currentDomain</code> when you
105
- * call the <code>load()</code> or
106
- * <code>loadBytes()</code> method.
107
- */
108
- get content(): DisplayObject;
109
- /**
110
- *
111
- */
112
- get contentLoader(): Loader;
113
- /**
114
- * Creates a Loader object that you can use to load files, such as SWF, JPEG,
115
- * GIF, or PNG files. Call the <code>load()</code> method to load the asset
116
- * as a child of the Loader instance. You can then add the Loader object to
117
- * the display list(for instance, by using the <code>addChild()</code>
118
- * method of a DisplayObjectContainer instance). The asset appears on the
119
- * Stage as it loads.
120
- *
121
- * <p>You can also use a Loader instance "offlist," that is without adding it
122
- * to a display object container on the display list. In this mode, the
123
- * Loader instance might be used to load a SWF file that contains additional
124
- * modules of an application. </p>
125
- *
126
- * <p>To detect when the SWF file is finished loading, you can use the events
127
- * of the LoaderInfo object associated with the
128
- * <code>contentLoaderInfo</code> property of the Loader object. At that
129
- * point, the code in the module SWF file can be executed to initialize and
130
- * start the module. In the offlist mode, a Loader instance might also be
131
- * used to load a SWF file that contains components or media assets. Again,
132
- * you can use the LoaderInfo object event notifications to detect when the
133
- * components are finished loading. At that point, the application can start
134
- * using the components and media assets in the library of the SWF file by
135
- * instantiating the ActionScript 3.0 classes that represent those components
136
- * and assets.</p>
137
- *
138
- * <p>To determine the status of a Loader object, monitor the following
139
- * events that the LoaderInfo object associated with the
140
- * <code>contentLoaderInfo</code> property of the Loader object:</p>
141
- *
142
- * <ul>
143
- * <li>The <code>open</code> event is dispatched when loading begins.</li>
144
- * <li>The <code>ioError</code> or <code>securityError</code> event is
145
- * dispatched if the file cannot be loaded or if an error occured during the
146
- * load process. </li>
147
- * <li>The <code>progress</code> event fires continuously while the file is
148
- * being loaded.</li>
149
- * <li>The <code>complete</code> event is dispatched when a file completes
150
- * downloading, but before the loaded movie clip's methods and properties are
151
- * available. </li>
152
- * <li>The <code>init</code> event is dispatched after the properties and
153
- * methods of the loaded SWF file are accessible, so you can begin
154
- * manipulating the loaded SWF file. This event is dispatched before the
155
- * <code>complete</code> handler. In streaming SWF files, the
156
- * <code>init</code> event can occur significantly earlier than the
157
- * <code>complete</code> event. For most purposes, use the <code>init</code>
158
- * handler.</li>
159
- * </ul>
160
- */
161
- constructor(useAssetLibrary?: boolean, assetLibraryId?: string);
162
- /**
163
- * Special addEventListener case for <code>
164
- * URLLoaderEvent.LOAD_ERROR</code> and <code>ype == ParserEvent.PARSE_ERROR</code>
165
- *
166
- * @param type
167
- * @param listener
168
- */
169
- addEventListener(type: string, listener: (event: EventBase) => void): void;
170
- /**
171
- * Special removeEventListener case for <code>
172
- * URLLoaderEvent.LOAD_ERROR</code> and <code>ype == ParserEvent.PARSE_ERROR</code>
173
- *
174
- * @param type
175
- * @param listener
176
- */
177
- removeEventListener(type: string, listener: (event: EventBase) => void): void;
178
- /**
179
- * Cancels a <code>load()</code> method operation that is currently in
180
- * progress for the Loader instance.
181
- *
182
- */
183
- close(): void;
184
- /**
185
- * Loads a SWF, JPEG, progressive JPEG, unanimated GIF, or PNG file into an
186
- * object that is a child of this Loader object. If you load an animated GIF
187
- * file, only the first frame is displayed. As the Loader object can contain
188
- * only a single child, issuing a subsequent <code>load()</code> request
189
- * terminates the previous request, if still pending, and commences a new
190
- * load.
191
- *
192
- * <p><b>Note</b>: In AIR 1.5 and Flash Player 10, the maximum size for a
193
- * loaded image is 8,191 pixels in width or height, and the total number of
194
- * pixels cannot exceed 16,777,215 pixels.(So, if an loaded image is 8,191
195
- * pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and
196
- * earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height
197
- * and 2,880 pixels in width.</p>
198
- *
199
- * <p>A SWF file or image loaded into a Loader object inherits the position,
200
- * rotation, and scale properties of the parent display objects of the Loader
201
- * object. </p>
202
- *
203
- * <p>Use the <code>unload()</code> method to remove movies or images loaded
204
- * with this method, or to cancel a load operation that is in progress.</p>
205
- *
206
- * <p>You can prevent a SWF file from using this method by setting the
207
- * <code>allowNetworking</code> parameter of the the <code>object</code> and
208
- * <code>embed</code> tags in the HTML page that contains the SWF
209
- * content.</p>
210
- *
211
- * <p>When you use this method, consider the Flash Player security model,
212
- * which is described in the Loader class description. </p>
213
- *
214
- * <p> In Flash Player 10 and later, if you use a multipart Content-Type(for
215
- * example "multipart/form-data") that contains an upload(indicated by a
216
- * "filename" parameter in a "content-disposition" header within the POST
217
- * body), the POST operation is subject to the security rules applied to
218
- * uploads:</p>
219
- *
220
- * <ul>
221
- * <li>The POST operation must be performed in response to a user-initiated
222
- * action, such as a mouse click or key press.</li>
223
- * <li>If the POST operation is cross-domain(the POST target is not on the
224
- * same server as the SWF file that is sending the POST request), the target
225
- * server must provide a URL policy file that permits cross-domain
226
- * access.</li>
227
- * </ul>
228
- *
229
- * <p>Also, for any multipart Content-Type, the syntax must be valid
230
- * (according to the RFC2046 standard). If the syntax appears to be invalid,
231
- * the POST operation is subject to the security rules applied to
232
- * uploads.</p>
233
- *
234
- * <p>For more information related to security, see the Flash Player
235
- * Developer Center Topic: <a
236
- * href="http://www.adobe.com/go/devnet_security_en"
237
- * scope="external">Security</a>.</p>
238
- *
239
- * @param request The absolute or relative URL of the SWF, JPEG, GIF, or PNG
240
- * file to be loaded. A relative path must be relative to the
241
- * main SWF file. Absolute URLs must include the protocol
242
- * reference, such as http:// or file:///. Filenames cannot
243
- * include disk drive specifications.
244
- * @param context A LoaderContext object, which has properties that define
245
- * the following:
246
- * <ul>
247
- * <li>Whether or not to check for the existence of a policy
248
- * file upon loading the object</li>
249
- * <li>The ApplicationDomain for the loaded object</li>
250
- * <li>The SecurityDomain for the loaded object</li>
251
- * <li>The ImageDecodingPolicy for the loaded image
252
- * object</li>
253
- * </ul>
254
- *
255
- * <p>If the <code>context</code> parameter is not specified
256
- * or refers to a null object, the loaded content remains in
257
- * its own security domain.</p>
258
- *
259
- * <p>For complete details, see the description of the
260
- * properties in the <a
261
- * href="../system/LoaderContext.html">LoaderContext</a>
262
- * class.</p>
263
- * @param ns An optional namespace string under which the file is to be
264
- * loaded, allowing the differentiation of two resources with
265
- * identical assets.
266
- * @param parser An optional parser object for translating the loaded data
267
- * into a usable resource. If not provided, Loader will
268
- * attempt to auto-detect the file type.
269
- * @throws IOError The <code>digest</code> property of the
270
- * <code>request</code> object is not
271
- * <code>null</code>. You should only set the
272
- * <code>digest</code> property of a URLRequest
273
- * object when calling the
274
- * <code>URLLoader.load()</code> method when
275
- * loading a SWZ file(an Adobe platform
276
- * component).
277
- * @throws IllegalOperationError If the <code>requestedContentParent</code>
278
- * property of the <code>context</code>
279
- * parameter is a <code>Loader</code>.
280
- * @throws IllegalOperationError If the <code>LoaderContext.parameters</code>
281
- * parameter is set to non-null and has some
282
- * values which are not Strings.
283
- * @throws SecurityError The value of
284
- * <code>LoaderContext.securityDomain</code>
285
- * must be either <code>null</code> or
286
- * <code>SecurityDomain.currentDomain</code>.
287
- * This reflects the fact that you can only
288
- * place the loaded media in its natural
289
- * security sandbox or your own(the latter
290
- * requires a policy file).
291
- * @throws SecurityError Local SWF files may not set
292
- * LoaderContext.securityDomain to anything
293
- * other than <code>null</code>. It is not
294
- * permitted to import non-local media into a
295
- * local sandbox, or to place other local media
296
- * in anything other than its natural sandbox.
297
- * @throws SecurityError You cannot connect to commonly reserved
298
- * ports. For a complete list of blocked ports,
299
- * see "Restricting Networking APIs" in the
300
- * <i>ActionScript 3.0 Developer's Guide</i>.
301
- * @throws SecurityError If the <code>applicationDomain</code> or
302
- * <code>securityDomain</code> properties of
303
- * the <code>context</code> parameter are from
304
- * a disallowed domain.
305
- * @throws SecurityError If a local SWF file is attempting to use the
306
- * <code>securityDomain</code> property of the
307
- * <code>context</code> parameter.
308
- * @event asyncError Dispatched by the <code>contentLoaderInfo</code>
309
- * object if the
310
- * <code>LoaderContext.requestedContentParent</code>
311
- * property has been specified and it is not possible to
312
- * add the loaded content as a child to the specified
313
- * DisplayObjectContainer. This could happen if the
314
- * loaded content is a
315
- * <code>flash.display.AVM1Movie</code> or if the
316
- * <code>addChild()</code> call to the
317
- * requestedContentParent throws an error.
318
- * @event complete Dispatched by the <code>contentLoaderInfo</code>
319
- * object when the file has completed loading. The
320
- * <code>complete</code> event is always dispatched
321
- * after the <code>init</code> event.
322
- * @event httpStatus Dispatched by the <code>contentLoaderInfo</code>
323
- * object when a network request is made over HTTP and
324
- * Flash Player can detect the HTTP status code.
325
- * @event init Dispatched by the <code>contentLoaderInfo</code>
326
- * object when the properties and methods of the loaded
327
- * SWF file are accessible. The <code>init</code> event
328
- * always precedes the <code>complete</code> event.
329
- * @event ioError Dispatched by the <code>contentLoaderInfo</code>
330
- * object when an input or output error occurs that
331
- * causes a load operation to fail.
332
- * @event open Dispatched by the <code>contentLoaderInfo</code>
333
- * object when the loading operation starts.
334
- * @event progress Dispatched by the <code>contentLoaderInfo</code>
335
- * object as data is received while load operation
336
- * progresses.
337
- * @event securityError Dispatched by the <code>contentLoaderInfo</code>
338
- * object if a SWF file in the local-with-filesystem
339
- * sandbox attempts to load content in the
340
- * local-with-networking sandbox, or vice versa.
341
- * @event securityError Dispatched by the <code>contentLoaderInfo</code>
342
- * object if the
343
- * <code>LoaderContext.requestedContentParent</code>
344
- * property has been specified and the security sandbox
345
- * of the
346
- * <code>LoaderContext.requestedContentParent</code>
347
- * does not have access to the loaded SWF.
348
- * @event unload Dispatched by the <code>contentLoaderInfo</code>
349
- * object when a loaded object is removed.
350
- */
351
- load(request: URLRequest, context?: LoaderContext, ns?: string, parser?: ParserBase): void;
352
- /**
353
- * Loads from binary data stored in a ByteArray object.
354
- *
355
- * <p>The <code>loadBytes()</code> method is asynchronous. You must wait for
356
- * the "init" event before accessing the properties of a loaded object.</p>
357
- *
358
- * <p>When you use this method, consider the Flash Player security model,
359
- * which is described in the Loader class description. </p>
360
- *
361
- * @param bytes A ByteArray object. The contents of the ByteArray can be
362
- * any of the file formats supported by the Loader class: SWF,
363
- * GIF, JPEG, or PNG.
364
- * @param context A LoaderContext object. Only the
365
- * <code>applicationDomain</code> property of the
366
- * LoaderContext object applies; the
367
- * <code>checkPolicyFile</code> and
368
- * <code>securityDomain</code> properties of the LoaderContext
369
- * object do not apply.
370
- *
371
- * <p>If the <code>context</code> parameter is not specified
372
- * or refers to a null object, the content is loaded into the
373
- * current security domain - a process referred to as "import
374
- * loading" in Flash Player security documentation.
375
- * Specifically, if the loading SWF file trusts the remote SWF
376
- * by incorporating the remote SWF into its code, then the
377
- * loading SWF can import it directly into its own security
378
- * domain.</p>
379
- *
380
- * <p>For more information related to security, see the Flash
381
- * Player Developer Center Topic: <a
382
- * href="http://www.adobe.com/go/devnet_security_en"
383
- * scope="external">Security</a>.</p>
384
- * @throws ArgumentError If the <code>length</code> property of the
385
- * ByteArray object is not greater than 0.
386
- * @throws IllegalOperationError If the <code>checkPolicyFile</code> or
387
- * <code>securityDomain</code> property of the
388
- * <code>context</code> parameter are non-null.
389
- * @throws IllegalOperationError If the <code>requestedContentParent</code>
390
- * property of the <code>context</code>
391
- * parameter is a <code>Loader</code>.
392
- * @throws IllegalOperationError If the <code>LoaderContext.parameters</code>
393
- * parameter is set to non-null and has some
394
- * values which are not Strings.
395
- * @throws SecurityError If the provided
396
- * <code>applicationDomain</code> property of
397
- * the <code>context</code> property is from a
398
- * disallowed domain.
399
- * @throws SecurityError You cannot connect to commonly reserved
400
- * ports. For a complete list of blocked ports,
401
- * see "Restricting Networking APIs" in the
402
- * <i>ActionScript 3.0 Developer's Guide</i>.
403
- * @event asyncError Dispatched by the <code>contentLoaderInfo</code>
404
- * object if the
405
- * <code>LoaderContext.requestedContentParent</code>
406
- * property has been specified and it is not possible to
407
- * add the loaded content as a child to the specified
408
- * DisplayObjectContainer. This could happen if the
409
- * loaded content is a
410
- * <code>flash.display.AVM1Movie</code> or if the
411
- * <code>addChild()</code> call to the
412
- * requestedContentParent throws an error.
413
- * @event complete Dispatched by the <code>contentLoaderInfo</code>
414
- * object when the operation is complete. The
415
- * <code>complete</code> event is always dispatched
416
- * after the <code>init</code> event.
417
- * @event init Dispatched by the <code>contentLoaderInfo</code>
418
- * object when the properties and methods of the loaded
419
- * data are accessible. The <code>init</code> event
420
- * always precedes the <code>complete</code> event.
421
- * @event ioError Dispatched by the <code>contentLoaderInfo</code>
422
- * object when the runtime cannot parse the data in the
423
- * byte array.
424
- * @event open Dispatched by the <code>contentLoaderInfo</code>
425
- * object when the operation starts.
426
- * @event progress Dispatched by the <code>contentLoaderInfo</code>
427
- * object as data is transfered in memory.
428
- * @event securityError Dispatched by the <code>contentLoaderInfo</code>
429
- * object if the
430
- * <code>LoaderContext.requestedContentParent</code>
431
- * property has been specified and the security sandbox
432
- * of the
433
- * <code>LoaderContext.requestedContentParent</code>
434
- * does not have access to the loaded SWF.
435
- * @event unload Dispatched by the <code>contentLoaderInfo</code>
436
- * object when a loaded object is removed.
437
- */
438
- loadData(data: any, context?: LoaderContext, ns?: string, parser?: ParserBase): void;
439
- private _getLoader;
440
- private _disposeLoader;
441
- /**
442
- * Removes a child of this Loader object that was loaded by using the
443
- * <code>load()</code> method. The <code>property</code> of the associated
444
- * LoaderInfo object is reset to <code>null</code>. The child is not
445
- * necessarily destroyed because other objects might have references to it;
446
- * however, it is no longer a child of the Loader object.
447
- *
448
- * <p>As a best practice, before you unload a child SWF file, you should
449
- * explicitly close any streams in the child SWF file's objects, such as
450
- * LocalConnection, NetConnection, NetStream, and Sound objects. Otherwise,
451
- * audio in the child SWF file might continue to play, even though the child
452
- * SWF file was unloaded. To close streams in the child SWF file, add an
453
- * event listener to the child that listens for the <code>unload</code>
454
- * event. When the parent calls <code>Loader.unload()</code>, the
455
- * <code>unload</code> event is dispatched to the child. The following code
456
- * shows how you might do this:</p>
457
- * <pre xml:space="preserve"> public closeAllStreams(evt:Event) {
458
- * myNetStream.close(); mySound.close(); myNetConnection.close();
459
- * myLocalConnection.close(); }
460
- * myMovieClip.loaderInfo.addEventListener(Event.UNLOAD,
461
- * closeAllStreams);</pre>
462
- *
463
- */
464
- unload(): void;
465
- /**
466
- * Enables a specific parser.
467
- * When no specific parser is set for a loading/parsing opperation,
468
- * loader3d can autoselect the correct parser to use.
469
- * A parser must have been enabled, to be considered when autoselecting the parser.
470
- *
471
- * @param parserClass The parser class to enable.
472
- * @see away.parsers.Parsers
473
- */
474
- static enableParser(parserClass: Object): void;
475
- /**
476
- * Enables a list of parsers.
477
- * When no specific parser is set for a loading/parsing opperation,
478
- * loader3d can autoselect the correct parser to use.
479
- * A parser must have been enabled, to be considered when autoselecting the parser.
480
- *
481
- * @param parserClasses A Vector of parser classes to enable.
482
- * @see away.parsers.Parsers
483
- */
484
- static enableParsers(parserClasses: Array<Object>): void;
485
- /**
486
- * .
487
- */
488
- private _onLoaderStart;
489
- private _onLoadProgress;
490
- private _onLoadComplete;
491
- private _onAssetComplete;
492
- /**
493
- * Called when an error occurs during loading
494
- */
495
- private _onLoadError;
496
- /**
497
- * Called when a an error occurs during parsing
498
- */
499
- private _onParseError;
500
- /**
501
- * Called when the resource and all of its dependencies was retrieved.
502
- */
503
- private _onLoaderComplete;
504
- }
1
+ import { Loader, LoaderContext, URLRequest, ParserBase, EventBase } from '@awayjs/core';
2
+ import { DisplayObjectContainer } from './DisplayObjectContainer';
3
+ import { DisplayObject } from './DisplayObject';
4
+ /**
5
+ * The LoaderContainer class is used to load SWF files or image(JPG, PNG, or GIF)
6
+ * files. Use the <code>load()</code> method to initiate loading. The loaded
7
+ * display object is added as a child of the LoaderContainer object.
8
+ *
9
+ * <p>Use the URLLoader class to load text or binary data.</p>
10
+ *
11
+ * <p>The LoaderContainer class overrides the following methods that it inherits,
12
+ * because a LoaderContainer object can only have one child display object - the
13
+ * display object that it loads. Calling the following methods throws an
14
+ * exception: <code>addChild()</code>, <code>addChildAt()</code>,
15
+ * <code>removeChild()</code>, <code>removeChildAt()</code>, and
16
+ * <code>setChildIndex()</code>. To remove a loaded display object, you must
17
+ * remove the <i>LoaderContainer</i> object from its parent DisplayObjectContainer
18
+ * child array. </p>
19
+ *
20
+ * <p><b>Note:</b> The ActionScript 2.0 MovieClipLoader and LoadVars classes
21
+ * are not used in ActionScript 3.0. The LoaderContainer and URLLoader classes replace
22
+ * them.</p>
23
+ *
24
+ * <p>When you use the LoaderContainer class, consider the Flash Player and Adobe AIR
25
+ * security model: </p>
26
+ *
27
+ * <ul>
28
+ * <li>You can load content from any accessible source. </li>
29
+ * <li>Loading is not allowed if the calling SWF file is in a network
30
+ * sandbox and the file to be loaded is local. </li>
31
+ * <li>If the loaded content is a SWF file written with ActionScript 3.0, it
32
+ * cannot be cross-scripted by a SWF file in another security sandbox unless
33
+ * that cross-scripting arrangement was approved through a call to the
34
+ * <code>System.allowDomain()</code> or the
35
+ * <code>System.allowInsecureDomain()</code> method in the loaded content
36
+ * file.</li>
37
+ * <li>If the loaded content is an AVM1 SWF file(written using ActionScript
38
+ * 1.0 or 2.0), it cannot be cross-scripted by an AVM2 SWF file(written using
39
+ * ActionScript 3.0). However, you can communicate between the two SWF files
40
+ * by using the LocalConnection class.</li>
41
+ * <li>If the loaded content is an image, its data cannot be accessed by a
42
+ * SWF file outside of the security sandbox, unless the domain of that SWF
43
+ * file was included in a URL policy file at the origin domain of the
44
+ * image.</li>
45
+ * <li>Movie clips in the local-with-file-system sandbox cannot script movie
46
+ * clips in the local-with-networking sandbox, and the reverse is also
47
+ * prevented. </li>
48
+ * <li>You cannot connect to commonly reserved ports. For a complete list of
49
+ * blocked ports, see "Restricting Networking APIs" in the <i>ActionScript 3.0
50
+ * Developer's Guide</i>. </li>
51
+ * </ul>
52
+ *
53
+ * <p>However, in AIR, content in the <code>application</code> security
54
+ * sandbox(content installed with the AIR application) are not restricted by
55
+ * these security limitations.</p>
56
+ *
57
+ * <p>For more information related to security, see the Flash Player Developer
58
+ * Center Topic: <a href="http://www.adobe.com/go/devnet_security_en"
59
+ * scope="external">Security</a>.</p>
60
+ *
61
+ * <p>When loading a SWF file from an untrusted source(such as a domain other
62
+ * than that of the LoaderContainer object's root SWF file), you may want to define a
63
+ * mask for the LoaderContainer object, to prevent the loaded content(which is a child
64
+ * of the LoaderContainer object) from drawing to portions of the Stage outside of that
65
+ * mask, as shown in the following code:</p>
66
+ */
67
+ export declare class LoaderContainer extends DisplayObjectContainer {
68
+ /**
69
+ * Dispatched when any asset finishes parsing. Also see specific events for each
70
+ * individual asset type (sprites, materials et c.)
71
+ *
72
+ * @eventType AssetEvent
73
+ */
74
+ /**
75
+ * Dispatched when a full resource (including dependencies) finishes loading.
76
+ *
77
+ * @eventType LoaderEvent
78
+ */
79
+ private _contentLoader;
80
+ private _useAssetLib;
81
+ private _assetLibId;
82
+ private _onLoaderStartDelegate;
83
+ private _onLoadProgressDelegate;
84
+ private _onLoadCompleteDelegate;
85
+ private _onAssetCompleteDelegate;
86
+ private _onLoaderCompleteDelegate;
87
+ private _onLoadErrorDelegate;
88
+ private _onParseErrorDelegate;
89
+ private _errorDelegateSelector;
90
+ private _content;
91
+ /**
92
+ * Contains the root display object of the SWF file or image(JPG, PNG, or
93
+ * GIF) file that was loaded by using the <code>load()</code> or
94
+ * <code>loadBytes()</code> methods.
95
+ *
96
+ * @throws SecurityError The loaded SWF file or image file belongs to a
97
+ * security sandbox to which you do not have access.
98
+ * For a loaded SWF file, you can avoid this situation
99
+ * by having the file call the
100
+ * <code>Security.allowDomain()</code> method or by
101
+ * having the loading file specify a
102
+ * <code>loaderContext</code> parameter with its
103
+ * <code>securityDomain</code> property set to
104
+ * <code>SecurityDomain.currentDomain</code> when you
105
+ * call the <code>load()</code> or
106
+ * <code>loadBytes()</code> method.
107
+ */
108
+ get content(): DisplayObject;
109
+ /**
110
+ *
111
+ */
112
+ get contentLoader(): Loader;
113
+ /**
114
+ * Creates a Loader object that you can use to load files, such as SWF, JPEG,
115
+ * GIF, or PNG files. Call the <code>load()</code> method to load the asset
116
+ * as a child of the Loader instance. You can then add the Loader object to
117
+ * the display list(for instance, by using the <code>addChild()</code>
118
+ * method of a DisplayObjectContainer instance). The asset appears on the
119
+ * Stage as it loads.
120
+ *
121
+ * <p>You can also use a Loader instance "offlist," that is without adding it
122
+ * to a display object container on the display list. In this mode, the
123
+ * Loader instance might be used to load a SWF file that contains additional
124
+ * modules of an application. </p>
125
+ *
126
+ * <p>To detect when the SWF file is finished loading, you can use the events
127
+ * of the LoaderInfo object associated with the
128
+ * <code>contentLoaderInfo</code> property of the Loader object. At that
129
+ * point, the code in the module SWF file can be executed to initialize and
130
+ * start the module. In the offlist mode, a Loader instance might also be
131
+ * used to load a SWF file that contains components or media assets. Again,
132
+ * you can use the LoaderInfo object event notifications to detect when the
133
+ * components are finished loading. At that point, the application can start
134
+ * using the components and media assets in the library of the SWF file by
135
+ * instantiating the ActionScript 3.0 classes that represent those components
136
+ * and assets.</p>
137
+ *
138
+ * <p>To determine the status of a Loader object, monitor the following
139
+ * events that the LoaderInfo object associated with the
140
+ * <code>contentLoaderInfo</code> property of the Loader object:</p>
141
+ *
142
+ * <ul>
143
+ * <li>The <code>open</code> event is dispatched when loading begins.</li>
144
+ * <li>The <code>ioError</code> or <code>securityError</code> event is
145
+ * dispatched if the file cannot be loaded or if an error occured during the
146
+ * load process. </li>
147
+ * <li>The <code>progress</code> event fires continuously while the file is
148
+ * being loaded.</li>
149
+ * <li>The <code>complete</code> event is dispatched when a file completes
150
+ * downloading, but before the loaded movie clip's methods and properties are
151
+ * available. </li>
152
+ * <li>The <code>init</code> event is dispatched after the properties and
153
+ * methods of the loaded SWF file are accessible, so you can begin
154
+ * manipulating the loaded SWF file. This event is dispatched before the
155
+ * <code>complete</code> handler. In streaming SWF files, the
156
+ * <code>init</code> event can occur significantly earlier than the
157
+ * <code>complete</code> event. For most purposes, use the <code>init</code>
158
+ * handler.</li>
159
+ * </ul>
160
+ */
161
+ constructor(useAssetLibrary?: boolean, assetLibraryId?: string);
162
+ /**
163
+ * Special addEventListener case for <code>
164
+ * URLLoaderEvent.LOAD_ERROR</code> and <code>ype == ParserEvent.PARSE_ERROR</code>
165
+ *
166
+ * @param type
167
+ * @param listener
168
+ */
169
+ addEventListener(type: string, listener: (event: EventBase) => void): void;
170
+ /**
171
+ * Special removeEventListener case for <code>
172
+ * URLLoaderEvent.LOAD_ERROR</code> and <code>ype == ParserEvent.PARSE_ERROR</code>
173
+ *
174
+ * @param type
175
+ * @param listener
176
+ */
177
+ removeEventListener(type: string, listener: (event: EventBase) => void): void;
178
+ /**
179
+ * Cancels a <code>load()</code> method operation that is currently in
180
+ * progress for the Loader instance.
181
+ *
182
+ */
183
+ close(): void;
184
+ /**
185
+ * Loads a SWF, JPEG, progressive JPEG, unanimated GIF, or PNG file into an
186
+ * object that is a child of this Loader object. If you load an animated GIF
187
+ * file, only the first frame is displayed. As the Loader object can contain
188
+ * only a single child, issuing a subsequent <code>load()</code> request
189
+ * terminates the previous request, if still pending, and commences a new
190
+ * load.
191
+ *
192
+ * <p><b>Note</b>: In AIR 1.5 and Flash Player 10, the maximum size for a
193
+ * loaded image is 8,191 pixels in width or height, and the total number of
194
+ * pixels cannot exceed 16,777,215 pixels.(So, if an loaded image is 8,191
195
+ * pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and
196
+ * earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height
197
+ * and 2,880 pixels in width.</p>
198
+ *
199
+ * <p>A SWF file or image loaded into a Loader object inherits the position,
200
+ * rotation, and scale properties of the parent display objects of the Loader
201
+ * object. </p>
202
+ *
203
+ * <p>Use the <code>unload()</code> method to remove movies or images loaded
204
+ * with this method, or to cancel a load operation that is in progress.</p>
205
+ *
206
+ * <p>You can prevent a SWF file from using this method by setting the
207
+ * <code>allowNetworking</code> parameter of the the <code>object</code> and
208
+ * <code>embed</code> tags in the HTML page that contains the SWF
209
+ * content.</p>
210
+ *
211
+ * <p>When you use this method, consider the Flash Player security model,
212
+ * which is described in the Loader class description. </p>
213
+ *
214
+ * <p> In Flash Player 10 and later, if you use a multipart Content-Type(for
215
+ * example "multipart/form-data") that contains an upload(indicated by a
216
+ * "filename" parameter in a "content-disposition" header within the POST
217
+ * body), the POST operation is subject to the security rules applied to
218
+ * uploads:</p>
219
+ *
220
+ * <ul>
221
+ * <li>The POST operation must be performed in response to a user-initiated
222
+ * action, such as a mouse click or key press.</li>
223
+ * <li>If the POST operation is cross-domain(the POST target is not on the
224
+ * same server as the SWF file that is sending the POST request), the target
225
+ * server must provide a URL policy file that permits cross-domain
226
+ * access.</li>
227
+ * </ul>
228
+ *
229
+ * <p>Also, for any multipart Content-Type, the syntax must be valid
230
+ * (according to the RFC2046 standard). If the syntax appears to be invalid,
231
+ * the POST operation is subject to the security rules applied to
232
+ * uploads.</p>
233
+ *
234
+ * <p>For more information related to security, see the Flash Player
235
+ * Developer Center Topic: <a
236
+ * href="http://www.adobe.com/go/devnet_security_en"
237
+ * scope="external">Security</a>.</p>
238
+ *
239
+ * @param request The absolute or relative URL of the SWF, JPEG, GIF, or PNG
240
+ * file to be loaded. A relative path must be relative to the
241
+ * main SWF file. Absolute URLs must include the protocol
242
+ * reference, such as http:// or file:///. Filenames cannot
243
+ * include disk drive specifications.
244
+ * @param context A LoaderContext object, which has properties that define
245
+ * the following:
246
+ * <ul>
247
+ * <li>Whether or not to check for the existence of a policy
248
+ * file upon loading the object</li>
249
+ * <li>The ApplicationDomain for the loaded object</li>
250
+ * <li>The SecurityDomain for the loaded object</li>
251
+ * <li>The ImageDecodingPolicy for the loaded image
252
+ * object</li>
253
+ * </ul>
254
+ *
255
+ * <p>If the <code>context</code> parameter is not specified
256
+ * or refers to a null object, the loaded content remains in
257
+ * its own security domain.</p>
258
+ *
259
+ * <p>For complete details, see the description of the
260
+ * properties in the <a
261
+ * href="../system/LoaderContext.html">LoaderContext</a>
262
+ * class.</p>
263
+ * @param ns An optional namespace string under which the file is to be
264
+ * loaded, allowing the differentiation of two resources with
265
+ * identical assets.
266
+ * @param parser An optional parser object for translating the loaded data
267
+ * into a usable resource. If not provided, Loader will
268
+ * attempt to auto-detect the file type.
269
+ * @throws IOError The <code>digest</code> property of the
270
+ * <code>request</code> object is not
271
+ * <code>null</code>. You should only set the
272
+ * <code>digest</code> property of a URLRequest
273
+ * object when calling the
274
+ * <code>URLLoader.load()</code> method when
275
+ * loading a SWZ file(an Adobe platform
276
+ * component).
277
+ * @throws IllegalOperationError If the <code>requestedContentParent</code>
278
+ * property of the <code>context</code>
279
+ * parameter is a <code>Loader</code>.
280
+ * @throws IllegalOperationError If the <code>LoaderContext.parameters</code>
281
+ * parameter is set to non-null and has some
282
+ * values which are not Strings.
283
+ * @throws SecurityError The value of
284
+ * <code>LoaderContext.securityDomain</code>
285
+ * must be either <code>null</code> or
286
+ * <code>SecurityDomain.currentDomain</code>.
287
+ * This reflects the fact that you can only
288
+ * place the loaded media in its natural
289
+ * security sandbox or your own(the latter
290
+ * requires a policy file).
291
+ * @throws SecurityError Local SWF files may not set
292
+ * LoaderContext.securityDomain to anything
293
+ * other than <code>null</code>. It is not
294
+ * permitted to import non-local media into a
295
+ * local sandbox, or to place other local media
296
+ * in anything other than its natural sandbox.
297
+ * @throws SecurityError You cannot connect to commonly reserved
298
+ * ports. For a complete list of blocked ports,
299
+ * see "Restricting Networking APIs" in the
300
+ * <i>ActionScript 3.0 Developer's Guide</i>.
301
+ * @throws SecurityError If the <code>applicationDomain</code> or
302
+ * <code>securityDomain</code> properties of
303
+ * the <code>context</code> parameter are from
304
+ * a disallowed domain.
305
+ * @throws SecurityError If a local SWF file is attempting to use the
306
+ * <code>securityDomain</code> property of the
307
+ * <code>context</code> parameter.
308
+ * @event asyncError Dispatched by the <code>contentLoaderInfo</code>
309
+ * object if the
310
+ * <code>LoaderContext.requestedContentParent</code>
311
+ * property has been specified and it is not possible to
312
+ * add the loaded content as a child to the specified
313
+ * DisplayObjectContainer. This could happen if the
314
+ * loaded content is a
315
+ * <code>flash.display.AVM1Movie</code> or if the
316
+ * <code>addChild()</code> call to the
317
+ * requestedContentParent throws an error.
318
+ * @event complete Dispatched by the <code>contentLoaderInfo</code>
319
+ * object when the file has completed loading. The
320
+ * <code>complete</code> event is always dispatched
321
+ * after the <code>init</code> event.
322
+ * @event httpStatus Dispatched by the <code>contentLoaderInfo</code>
323
+ * object when a network request is made over HTTP and
324
+ * Flash Player can detect the HTTP status code.
325
+ * @event init Dispatched by the <code>contentLoaderInfo</code>
326
+ * object when the properties and methods of the loaded
327
+ * SWF file are accessible. The <code>init</code> event
328
+ * always precedes the <code>complete</code> event.
329
+ * @event ioError Dispatched by the <code>contentLoaderInfo</code>
330
+ * object when an input or output error occurs that
331
+ * causes a load operation to fail.
332
+ * @event open Dispatched by the <code>contentLoaderInfo</code>
333
+ * object when the loading operation starts.
334
+ * @event progress Dispatched by the <code>contentLoaderInfo</code>
335
+ * object as data is received while load operation
336
+ * progresses.
337
+ * @event securityError Dispatched by the <code>contentLoaderInfo</code>
338
+ * object if a SWF file in the local-with-filesystem
339
+ * sandbox attempts to load content in the
340
+ * local-with-networking sandbox, or vice versa.
341
+ * @event securityError Dispatched by the <code>contentLoaderInfo</code>
342
+ * object if the
343
+ * <code>LoaderContext.requestedContentParent</code>
344
+ * property has been specified and the security sandbox
345
+ * of the
346
+ * <code>LoaderContext.requestedContentParent</code>
347
+ * does not have access to the loaded SWF.
348
+ * @event unload Dispatched by the <code>contentLoaderInfo</code>
349
+ * object when a loaded object is removed.
350
+ */
351
+ load(request: URLRequest, context?: LoaderContext, ns?: string, parser?: ParserBase): void;
352
+ /**
353
+ * Loads from binary data stored in a ByteArray object.
354
+ *
355
+ * <p>The <code>loadBytes()</code> method is asynchronous. You must wait for
356
+ * the "init" event before accessing the properties of a loaded object.</p>
357
+ *
358
+ * <p>When you use this method, consider the Flash Player security model,
359
+ * which is described in the Loader class description. </p>
360
+ *
361
+ * @param bytes A ByteArray object. The contents of the ByteArray can be
362
+ * any of the file formats supported by the Loader class: SWF,
363
+ * GIF, JPEG, or PNG.
364
+ * @param context A LoaderContext object. Only the
365
+ * <code>applicationDomain</code> property of the
366
+ * LoaderContext object applies; the
367
+ * <code>checkPolicyFile</code> and
368
+ * <code>securityDomain</code> properties of the LoaderContext
369
+ * object do not apply.
370
+ *
371
+ * <p>If the <code>context</code> parameter is not specified
372
+ * or refers to a null object, the content is loaded into the
373
+ * current security domain - a process referred to as "import
374
+ * loading" in Flash Player security documentation.
375
+ * Specifically, if the loading SWF file trusts the remote SWF
376
+ * by incorporating the remote SWF into its code, then the
377
+ * loading SWF can import it directly into its own security
378
+ * domain.</p>
379
+ *
380
+ * <p>For more information related to security, see the Flash
381
+ * Player Developer Center Topic: <a
382
+ * href="http://www.adobe.com/go/devnet_security_en"
383
+ * scope="external">Security</a>.</p>
384
+ * @throws ArgumentError If the <code>length</code> property of the
385
+ * ByteArray object is not greater than 0.
386
+ * @throws IllegalOperationError If the <code>checkPolicyFile</code> or
387
+ * <code>securityDomain</code> property of the
388
+ * <code>context</code> parameter are non-null.
389
+ * @throws IllegalOperationError If the <code>requestedContentParent</code>
390
+ * property of the <code>context</code>
391
+ * parameter is a <code>Loader</code>.
392
+ * @throws IllegalOperationError If the <code>LoaderContext.parameters</code>
393
+ * parameter is set to non-null and has some
394
+ * values which are not Strings.
395
+ * @throws SecurityError If the provided
396
+ * <code>applicationDomain</code> property of
397
+ * the <code>context</code> property is from a
398
+ * disallowed domain.
399
+ * @throws SecurityError You cannot connect to commonly reserved
400
+ * ports. For a complete list of blocked ports,
401
+ * see "Restricting Networking APIs" in the
402
+ * <i>ActionScript 3.0 Developer's Guide</i>.
403
+ * @event asyncError Dispatched by the <code>contentLoaderInfo</code>
404
+ * object if the
405
+ * <code>LoaderContext.requestedContentParent</code>
406
+ * property has been specified and it is not possible to
407
+ * add the loaded content as a child to the specified
408
+ * DisplayObjectContainer. This could happen if the
409
+ * loaded content is a
410
+ * <code>flash.display.AVM1Movie</code> or if the
411
+ * <code>addChild()</code> call to the
412
+ * requestedContentParent throws an error.
413
+ * @event complete Dispatched by the <code>contentLoaderInfo</code>
414
+ * object when the operation is complete. The
415
+ * <code>complete</code> event is always dispatched
416
+ * after the <code>init</code> event.
417
+ * @event init Dispatched by the <code>contentLoaderInfo</code>
418
+ * object when the properties and methods of the loaded
419
+ * data are accessible. The <code>init</code> event
420
+ * always precedes the <code>complete</code> event.
421
+ * @event ioError Dispatched by the <code>contentLoaderInfo</code>
422
+ * object when the runtime cannot parse the data in the
423
+ * byte array.
424
+ * @event open Dispatched by the <code>contentLoaderInfo</code>
425
+ * object when the operation starts.
426
+ * @event progress Dispatched by the <code>contentLoaderInfo</code>
427
+ * object as data is transfered in memory.
428
+ * @event securityError Dispatched by the <code>contentLoaderInfo</code>
429
+ * object if the
430
+ * <code>LoaderContext.requestedContentParent</code>
431
+ * property has been specified and the security sandbox
432
+ * of the
433
+ * <code>LoaderContext.requestedContentParent</code>
434
+ * does not have access to the loaded SWF.
435
+ * @event unload Dispatched by the <code>contentLoaderInfo</code>
436
+ * object when a loaded object is removed.
437
+ */
438
+ loadData(data: any, context?: LoaderContext, ns?: string, parser?: ParserBase): void;
439
+ private _getLoader;
440
+ private _disposeLoader;
441
+ /**
442
+ * Removes a child of this Loader object that was loaded by using the
443
+ * <code>load()</code> method. The <code>property</code> of the associated
444
+ * LoaderInfo object is reset to <code>null</code>. The child is not
445
+ * necessarily destroyed because other objects might have references to it;
446
+ * however, it is no longer a child of the Loader object.
447
+ *
448
+ * <p>As a best practice, before you unload a child SWF file, you should
449
+ * explicitly close any streams in the child SWF file's objects, such as
450
+ * LocalConnection, NetConnection, NetStream, and Sound objects. Otherwise,
451
+ * audio in the child SWF file might continue to play, even though the child
452
+ * SWF file was unloaded. To close streams in the child SWF file, add an
453
+ * event listener to the child that listens for the <code>unload</code>
454
+ * event. When the parent calls <code>Loader.unload()</code>, the
455
+ * <code>unload</code> event is dispatched to the child. The following code
456
+ * shows how you might do this:</p>
457
+ * <pre xml:space="preserve"> public closeAllStreams(evt:Event) {
458
+ * myNetStream.close(); mySound.close(); myNetConnection.close();
459
+ * myLocalConnection.close(); }
460
+ * myMovieClip.loaderInfo.addEventListener(Event.UNLOAD,
461
+ * closeAllStreams);</pre>
462
+ *
463
+ */
464
+ unload(): void;
465
+ /**
466
+ * Enables a specific parser.
467
+ * When no specific parser is set for a loading/parsing opperation,
468
+ * loader3d can autoselect the correct parser to use.
469
+ * A parser must have been enabled, to be considered when autoselecting the parser.
470
+ *
471
+ * @param parserClass The parser class to enable.
472
+ * @see away.parsers.Parsers
473
+ */
474
+ static enableParser(parserClass: Object): void;
475
+ /**
476
+ * Enables a list of parsers.
477
+ * When no specific parser is set for a loading/parsing opperation,
478
+ * loader3d can autoselect the correct parser to use.
479
+ * A parser must have been enabled, to be considered when autoselecting the parser.
480
+ *
481
+ * @param parserClasses A Vector of parser classes to enable.
482
+ * @see away.parsers.Parsers
483
+ */
484
+ static enableParsers(parserClasses: Array<Object>): void;
485
+ /**
486
+ * .
487
+ */
488
+ private _onLoaderStart;
489
+ private _onLoadProgress;
490
+ private _onLoadComplete;
491
+ private _onAssetComplete;
492
+ /**
493
+ * Called when an error occurs during loading
494
+ */
495
+ private _onLoadError;
496
+ /**
497
+ * Called when a an error occurs during parsing
498
+ */
499
+ private _onParseError;
500
+ /**
501
+ * Called when the resource and all of its dependencies was retrieved.
502
+ */
503
+ private _onLoaderComplete;
504
+ }
505
505
  //# sourceMappingURL=LoaderContainer.d.ts.map