MANDAR

Load SWF into MovieClip in AS3

Posted in Flash Designer by Mandar on May 12, 2009

Loading external swf file is essay in AS2.0 but it is not so essay in AS3.0, to load swf file need to define loader class and URL path pointing to the external swf.

var swfLoader:Loader = new Loader();

holderMC.addChild(swfLoader);

var bgURL:URLRequest = new URLRequest(“loadSWF_File.swf”);

swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);

swfLoader.load(bgURL);

function loadProdComplete(e:Event):void {

trace(“file loaded”);

}


Leave a Reply

You must be logged in to post a comment.