PDA

View Full Version : Loading an external SWF with an AS file included



jazone
October 16th, 2008, 04:04 PM
Hi there.

I have a movie where I need to load an external SWF. I read a lot about the URLRequest and the LOADER but I can't load the SWF.

But I saw something interesting, this external file is using an AS file where all the classes are declared, so when I load the SWF without the AS file, the loader of course load the file, but when I add the AS file I can't load the movie.

Can some one help me.

alexstudio
October 16th, 2008, 04:21 PM
var rIndex:URLRequest = new URLRequest("index.swf");
var myLoader:Loader = new Loader();
myLoader.load(rIndex);
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE,showLoadResult);
function showLoadResult(evt:Event):void {
addChild(myLoader);
}


replace index.swf with the name of the swf you need to load

jazone
October 16th, 2008, 05:02 PM
Thanks man, it's working. Thanks.