Hi!
I hope I’m making sense on this. But is there a way to addChild twice on a preloaded swf?
Here’s my code:
stop();
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
hideEmpty();
function hideEmpty()
{
empty1_mc.visible =
empty2_mc.visible = false;
}
function showEmpty()
{
trace("show");
empty1_mc.visible =
empty2_mc.visible = true;
}
var mLoader:Loader = new Loader();
var loadernum = 0;
var mySwf:String = "";
function onCompleteHandler(loadEvent:Event)
{
trace("loader num is " + loadernum);
empty1_mc.addChild(loadEvent.currentTarget.content);
empty2_mc.addChild(loadEvent.currentTarget.content);
stopLoad();
}
function onProgressHandler(mProgress:ProgressEvent)
{
var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
trace(percent);
}
function beginLoad()
{
mySwf = "smashermerc.swf";
var mRequest1:URLRequest = new URLRequest(mySwf);
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
mLoader.load(mRequest1);
}
beginLoad();
function stopLoad()
{
showEmpty();
mLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, onProgressHandler);
this.stop();
}
Hope someone can help.