# Unloading a movie with a button click in loaded movie

**URL:** <https://forum.kirupa.com/t/unloading-a-movie-with-a-button-click-in-loaded-movie/315495>\
**Category:** Uncategorized\
**Created:** [October 27, 2010, 3:31pm UTC](https://forum.kirupa.com/t/unloading-a-movie-with-a-button-click-in-loaded-movie/315495 "2010-10-27T15:31:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bazookaman](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bazookaman](https://forum.kirupa.com/u/bazookaman)\
**Post date:** [October 27, 2010, 3:31pm UTC](https://forum.kirupa.com/t/unloading-a-movie-with-a-button-click-in-loaded-movie/315495/1 "2010-10-27T15:31:55Z")

</div>

I have a movie clip (a) with a button that will load movie clip (b) when clicked. It loads (b) on top of (a) which is exactly what i want.

Now the problem. I have a button in (b) that I want to use to close (or unload) (b).

This is the code in (a) that loads (b):

```auto
spinner_mc.production.addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler2);
function doubleClickHandler2(event:MouseEvent):void {
    var myLoader:Loader = new Loader();
    addChild(myLoader);
    var url:URLRequest = new URLRequest("production-04.swf");
    myLoader.load(url); 
}

```
