ClassLoader

I have made some classes to load external assets (Classes)…
Generally it is used to load a .swf containing BitmapDatas, Fonts, MovieClips and use then instantly by calling new Asset(). Not using flash.utils.getDefinitionByName each time. This was acheived by loading into currentDomain (Merging definitions with existing .swf).

Here is working example with ProgressBar loaded too:
http://felixz.marknaegeli.com/test
First is loaded ProgressBar.swf and shown on the stage to monitor progress, then other 2 files including font and ‘frog’.
This class can load assets from different files one-by-one using prioritized queue. Also it can retry on IOError, pause, cancel or resume download…
It can load from array or from a number of parameters which can be strings or


public function LoadedClass(url, priority, parameters) {

for now parameters is used to register fonts.
I’m interested in your opinions and cooperative work to improve this class.
This class has also one ditterent event approach regarding notifying about loaded class availability, but standard one is working too.

ClassLoader.Instance.addEventListener(ClassLoaderEvent.COMPLETE + "Assets.swf",doSomething);</p>
ClassLoader.Instance.load("Assets.swf");

Dispatched Events so far:


public static var ALL_COMPLETE:String="all" + Event.COMPLETE;
public static var COMPLETE:String=Event.COMPLETE;
public static var START:String="start";
public static var FAIL:String=ErrorEvent.ERROR;
public static var OPEN:String=Event.OPEN;
public static var IO_ERROR:String=IOErrorEvent.IO_ERROR;
public static var PROGRESS:String=ProgressEvent.PROGRESS;
//and Event.COMPLETE + loadedURL for quick use
//and Event.OPEN + loadedURL for quick use

Also it exposes variables needed to use that class with fl.controls.ProgressBar.
It uses a Singleton pattern.
There is just one more instance of loading using this class:


ClassLoader.Instance.load(new LoadedClass("Font.swf",-2,{font:["SegoeUI14","SegoeUI14Bold","SegoeUI14Italic"]}),new LoadedClass("ProgressBar.swf",10));

If my project is interesting enough, I could make some more documentation.
Update: the net .zip file contains an updated version.