# Unload content of a MovieClip

**URL:** <https://forum.kirupa.com/t/unload-content-of-a-movieclip/252077>\
**Category:** flash\
**Created:** [February 15, 2008, 5:03pm UTC](https://forum.kirupa.com/t/unload-content-of-a-movieclip/252077 "2008-02-15T17:03:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecptavares](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@ecptavares](https://forum.kirupa.com/u/ecptavares)\
**Post date:** [February 15, 2008, 5:03pm UTC](https://forum.kirupa.com/t/unload-content-of-a-movieclip/252077/1 "2008-02-15T17:03:03Z")

</div>

Hi!

I have 4 MC working as a button and when I click one of them I want to unload the content of a MC that I use to load external’s MovieClips and load a new one inside this “stage” MovieClip. I am using a function that recieves which external swf to load.  
My question is how to unload the previous content of the empty movie clip?

Here is my function:

```auto
function loadSWF(swf:String) : void
{
   var loader : Loader = new Loader();
   var url : URLRequest = new URLRequest(swf)
   
   loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onProgress);
   loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
   loader.load(url);
   mainBox.holder.addChild(loader);
}

```
