# Completely unloading an external SWF

**URL:** <https://forum.kirupa.com/t/completely-unloading-an-external-swf/283905>\
**Category:** flash\
**Created:** [March 12, 2009, 10:36am UTC](https://forum.kirupa.com/t/completely-unloading-an-external-swf/283905 "2009-03-12T10:36:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackcoma](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@blackcoma](https://forum.kirupa.com/u/blackcoma)\
**Post date:** [March 12, 2009, 10:36am UTC](https://forum.kirupa.com/t/completely-unloading-an-external-swf/283905/1 "2009-03-12T10:36:21Z")

</div>

Hi,  
I’m working on a project in which I’m loading an external AS2 swf file onto the main stage.

To load the movie I’m using this code:

```auto
var request:URLRequest = new URLRequest(filename);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
loader.load(request);

```

In the loadComplete function I’m adding the loaded swf into the a movieclip (which is assinged to the class in which this code is written):

```auto
function loadComplete(event:Event):void {
    trace("Complete");
addChild(event.currentTarget.content);
}

```

Thing is, when I use removeChild on the movieclip, I can still hear the sound of the swf file, which means, it wasn’t really unloaded when I removed the movieclip containing it.

How can I completely unload the swf?

Thanks.
