the thing is my mind still thinks like as2 :diss:, i did some test it works but somehow i know theres somthing wrong on what i did. in this sample that i created i just simply loading 3 different colors all of them are external swf’s. my question is can you pls help me on whats the proper way in doing it…
heres the code
var loader:Loader = new Loader();
var movieRequest:URLRequest = new URLRequest("home.swf");
loader.load(movieRequest);
emc.addChild(loader);
btn1.addEventListener(MouseEvent.CLICK, home);
function home(Event:MouseEvent):void {
var movieRequest:URLRequest = new URLRequest("home.swf");
loader.load(movieRequest);
emc.addChild(loader);
//removeChild(emc);
loader.unload();
trace(emc.numChildren);
}
btn2.addEventListener(MouseEvent.CLICK, about);
function about(Event:MouseEvent):void {
var movieRequest:URLRequest = new URLRequest("about.swf");
loader.load(movieRequest);
emc.addChild(loader);
//removeChild(emc);
loader.unload();
trace(emc.numChildren);
}
btn3.addEventListener(MouseEvent.CLICK, contact);
function contact(Event:MouseEvent):void {
var movieRequest:URLRequest = new URLRequest("contact.swf");
loader.load(movieRequest);
emc.addChild(loader);
//removeChild(emc);
loader.unload();
trace(emc.numChildren);
}
thanks for everyone in advanced