i loaded before external swf.
but this is the first time i see how to load using this technique.
in the help, contentLoaderInfo:
Returns a LoaderInfo object corresponding to the object being loaded. ** LoaderInfo objects are shared between the Loader object and the loaded content object.** The LoaderInfo object supplies loading progress information and statistics about the loaded file.
Events related to the load are dispatched by the LoaderInfo object referenced by the contentLoaderInfo property of the Loader object. The contentLoaderInfo property is set to a valid LoaderInfo object, even before the content is loaded, so that you can add event listeners to the object prior to the load.
i tried to understand what is the **content **keyword. i looked in the help, but i did not get its job.
var container:Sprite = new Sprite();
addChild(container);
var pictLdr:Loader = new Loader();
var pictURLReq:URLRequest = new URLRequest("banana.jpg");
pictLdr.load(pictURLReq);
pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
function imgLoaded(event:Event):void {
container.addChild(pictLdr.content);
}