Added loadClasses(), for convenience of the common pattern of loading

stuff into an ApplicationDomain.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5658 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2009-02-18 19:38:55 +00:00
parent 6839b98d4d
commit 302665c65a
+21
View File
@@ -149,6 +149,27 @@ public class MultiLoader
new MultiLoader(sources, complete, generator, forEach);
}
/**
* Loads classes into the specified ApplicationDomain.
* The complete callback receives either the same ApplicationDomain or no arguments.
*/
public static function loadClasses (
sources :Object, appDom :ApplicationDomain, completeCallback :Function) :void
{
var complete :Function = function (retval :Object) :void {
switch (completeCallback.length) {
default:
completeCallback();
break;
case 1:
completeCallback(appDom);
break;
}
};
getLoaders(sources, complete, false, appDom);
}
/**
* Coordinate loading some asynchronous objects.
*