I want to have a function that loads a SWF and returns the SWF. But how do I have the COMPLETE function (which is triggered by an event) return the MovieClip? Here the isLoaded function returns the clip, but the main function has no return statement. Where/how do I place that?
loadClip ('someclip.swf');
//
function loadClip (whichSWF:String):MovieClip {
myLoader = new Loader;
myLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, isLoaded);
function isLoaded (event:Event):MovieClip {
return (myLoader.content);
}
myLoader.load (new URLRequest(whichSWF));
}