# Improving code how to?

**URL:** <https://forum.kirupa.com/t/improving-code-how-to/297727>\
**Category:** flash\
**Created:** [October 7, 2009, 5:33pm UTC](https://forum.kirupa.com/t/improving-code-how-to/297727 "2009-10-07T17:33:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raccoon](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Raccoon](https://forum.kirupa.com/u/Raccoon)\
**Post date:** [October 7, 2009, 5:33pm UTC](https://forum.kirupa.com/t/improving-code-how-to/297727/1 "2009-10-07T17:33:21Z")

</div>

Hello i want to know, if is possible, how can i improve this code?:  
Thanks

```auto

     // 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
