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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user