# memory issue in Removing an external swf from stage

**URL:** <https://forum.kirupa.com/t/memory-issue-in-removing-an-external-swf-from-stage/634976>\
**Category:** flash\
**Created:** [July 24, 2016, 1:09pm UTC](https://forum.kirupa.com/t/memory-issue-in-removing-an-external-swf-from-stage/634976 "2016-07-24T13:09:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bonnyelangbam](https://avatars.discourse-cdn.com/v4/letter/b/8491ac/32.png) [@bonnyelangbam](https://forum.kirupa.com/u/bonnyelangbam)\
**Post date:** [July 24, 2016, 1:09pm UTC](https://forum.kirupa.com/t/memory-issue-in-removing-an-external-swf-from-stage/634976/1 "2016-07-24T13:09:14Z")

</div>

I had 28 swf files, which are connected with a main swf, and the main swf is loaded external to a blank swf.  
On the main swf there a 26 buttons which are linked to 26 swf and each 26 swf have a back button which will return to the main swf.  
All are working fine accept the memory issue. Please help me with this

The script I used in the main swf to go to the other 26 swf is

```
var loader_mc : Loader = new Loader();
   addChild(loader_mc);

btn_main_apple.addEventListener(MouseEvent.CLICK, buttonClick)
function buttonClick(e:MouseEvent):void
{
     try{
loader_mc.unloadAndStop();
} catch(e:Error) {
}
      var urlRequest : URLRequest = new URLRequest("FitzroySound_A.swf");
      loader_mc.load(urlRequest);
}   

btn_main_bird.addEventListener(MouseEvent.CLICK, buttonClick2bird)
function buttonClick2bird(e:MouseEvent):void
{
     try{
loader_mc.unloadAndStop();
} catch(e:Error) {
}
      var urlRequest : URLRequest = new URLRequest("FitzroySound_B.swf");
      loader_mc.load(urlRequest);
}

btn_main_cat.addEventListener(MouseEvent.CLICK, buttonClickCat)
function buttonClickCat(e:MouseEvent):void
{
     try{
loader_mc.unloadAndStop();
} catch(e:Error) {
}
      var urlRequest : URLRequest = new URLRequest("FitzroySound_C.swf");
      loader_mc.load(urlRequest);
}

```

and so on…

And the script I used on the other 26 swf to return to the main swf is

```
var loader_mc : Loader = new Loader();
addChild(loader_mc);

logout_btn_drw_z.addEventListener(MouseEvent.CLICK, buttonClick)
function buttonClick(e:MouseEvent):void
{
     try{
loader_mc.unloadAndStop();
} catch(e:Error) {
}
      var urlRequest : URLRequest = new URLRequest("FitzroySound_mainScreen.swf");
      loader_mc.load(urlRequest);
}   

```

Please help me
