Hello i want to know, if is possible, how can i improve this code?:
Thanks
// set listeners mainButtons
menu.nosotros.addEventListener(MouseEvent.MOUSE_DOWN, clickMain);
function clickMain(e:MouseEvent):void {
var ldr:Loader = new Loader();
var urlReq:URLRequest = new URLRequest(""+ e.target.name +".swf");
ldr.load(urlReq);
function loadHandler (e:Event) {
var myClip:MovieClip = e.target.content;
addChild(myClip);
///////////////////////////////////////////////////////////////
function clickSub(e:MouseEvent):void {
myClip.nosotrosmc.gotoAndStop("historia");
//myClip.islasmc.gotoAndStop(e.target.name);
}
menu.nosotros.addEventListener(MouseEvent.MOUSE_UP, clickSub);
}
// listener
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
}
And another question, how to remove the loaded file, if i add more files ?
thanks