PDA

View Full Version : Load External SWF files into a Movie Clip



alemieux34
June 25th, 2007, 04:55 PM
I can load an external SWF into another movie like so:


var loadRequest:URLRequest = new URLRequest("content.swf");
var swfLoader:Loader = new Loader();
swfLoader.load(loadRequest);
addChild(swfLoader);
swfLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, onComplete);
function onComplete(event:Event):void {
trace("swf loaded");
}

I have a Movie Clip called load_mc. How can I get the content.swf to load into that location?

alemieux34
June 25th, 2007, 05:46 PM
I managed to figure it out. You tell the addChild method where to load the movie, so:

load_mc.addChild(swfLoader).

Thanks.



I can load an external SWF into another movie like so:


var loadRequest:URLRequest = new URLRequest("content.swf");
var swfLoader:Loader = new Loader();
swfLoader.load(loadRequest);
addChild(swfLoader);
swfLoader.contentLoaderInfo.addEventListener(Event .COMPLETE, onComplete);
function onComplete(event:Event):void {
trace("swf loaded");
}I have a Movie Clip called load_mc. How can I get the content.swf to load into that location?