Touched up the examples.
Added an example for the advanced case of loading classes at runtime. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4963 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -48,17 +48,18 @@ public class MultiLoader
|
|||||||
* @param appDom the ApplicationDomain in which to load the contents, or null to specify
|
* @param appDom the ApplicationDomain in which to load the contents, or null to specify
|
||||||
* that it should load in a child of the current ApplicationDomain.
|
* that it should load in a child of the current ApplicationDomain.
|
||||||
*
|
*
|
||||||
* @example
|
* @example Load one embed, add it as a child.
|
||||||
* <listing version="3.0">
|
* <listing version="3.0">
|
||||||
* MultiLoader.getContents(EMBED_CONSTANT, addChild);
|
* MultiLoader.getContents(EMBED_CONSTANT, addChild);
|
||||||
* </listing>
|
* </listing>
|
||||||
*
|
*
|
||||||
* @example
|
* @example Load 3 embeds, add them as children.
|
||||||
* <listing version="3.0">
|
* <listing version="3.0">
|
||||||
* MultiLoader.getContents([EMBED1, EMBED2, EMBED3], addChild, true);
|
* MultiLoader.getContents([EMBED1, EMBED2, EMBED3], addChild, true);
|
||||||
* </listing>
|
* </listing>
|
||||||
*
|
*
|
||||||
* @example
|
* @example Load multiple URLs, have the contents returned to the result function one at
|
||||||
|
* a time.
|
||||||
* <listing version="3.0">
|
* <listing version="3.0">
|
||||||
* function handleComplete (result :Object) :void {
|
* function handleComplete (result :Object) :void {
|
||||||
* // process a result here. Result may be a DisplayObject or an Error.
|
* // process a result here. Result may be a DisplayObject or an Error.
|
||||||
@@ -72,7 +73,7 @@ public class MultiLoader
|
|||||||
* MultiLoader.getContents(obj, handleComplete, true);
|
* MultiLoader.getContents(obj, handleComplete, true);
|
||||||
* </listing>
|
* </listing>
|
||||||
*
|
*
|
||||||
* @example
|
* @example Load 3 embeds, wait to handle them until they're all loaded.
|
||||||
* <listing version="3.0">
|
* <listing version="3.0">
|
||||||
* function handleComplete (results :Array) :void {
|
* function handleComplete (results :Array) :void {
|
||||||
* // process results here
|
* // process results here
|
||||||
@@ -93,6 +94,24 @@ public class MultiLoader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Exactly like getContents() only it returns the Loader objects rather than their contents.
|
* Exactly like getContents() only it returns the Loader objects rather than their contents.
|
||||||
|
*
|
||||||
|
* @example Advanced usage: Loading classes.
|
||||||
|
* <listing version="3.0">
|
||||||
|
* // A holder for new classes, created as a child of the system domain.
|
||||||
|
* var appDom :ApplicationDomain = new ApplicationDomain(null);
|
||||||
|
* <br/>
|
||||||
|
* function handleComplete (results :Object) :void {
|
||||||
|
* // now we can retrieve classes
|
||||||
|
* var clazz :Class = appDom.getDefinition("com.package.SomeClass") as Class;
|
||||||
|
* }
|
||||||
|
* <br/>
|
||||||
|
* // load all the classes contained in the specified sources
|
||||||
|
* MultiLoader.getLoaders([EMBED, "http://site.com/pack.swf"], handleComplete, false, appDom);
|
||||||
|
* <br/>
|
||||||
|
* [Embed(source="resource.swf", mimeType="application/octet-stream")]
|
||||||
|
* private static const EMBED :Class;
|
||||||
|
* </listing>
|
||||||
|
*
|
||||||
* @see getContents()
|
* @see getContents()
|
||||||
*/
|
*/
|
||||||
public static function getLoaders (
|
public static function getLoaders (
|
||||||
|
|||||||
Reference in New Issue
Block a user