Recently in a project I configured a custom Loader class as follows First I define my Loader as a private variabel
private var _myLdr:Loader
//Then in the constructor
_myLdr = new Loader();
_myLdr.contentLoaderInfo.addEventListener( Event.COMPLETE, doneImgLoad );
_myLdr.contentLoaderInfo.addEventListener( ProgressEvent.PROGRESS, loadProgress );
_myLdr.contentLoaderInfo.addEventListener( IOErrorEvent.IO_ERROR, ioError );
And then finally when I need to load a new asset I call my Loader instance via a public method
_myLdr.load(new URLRequest ('myswftoLoad.swf') );
So far so good....UNLESS you happen to view your page using the debug version of FlashPlayer 9.024 in which case you get
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::Loader/_load()
WTF???!!
So to correct I need to instantiate a new loader EVERY time I load a new asset.
Can someone tell me which method would be considered a 'best practice'?