# Unload a movie - as included

**URL:** <https://forum.kirupa.com/t/unload-a-movie-as-included/298196>\
**Category:** Uncategorized\
**Created:** [October 15, 2009, 12:10am UTC](https://forum.kirupa.com/t/unload-a-movie-as-included/298196 "2009-10-15T00:10:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuma\_jon](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@kuma\_jon](https://forum.kirupa.com/u/kuma_jon)\
**Post date:** [October 15, 2009, 12:10am UTC](https://forum.kirupa.com/t/unload-a-movie-as-included/298196/1 "2009-10-15T00:10:07Z")

</div>

I’m currently working with this code, and am wondering how to unload 01.swf when I click on btn\_02 to load 02.swf, rather than just loading over the top of 01.swf.

Any suggestions for better code, warmly welcomed! This has worked, but seems to come up with errors adding new buttons (which I want to do)

=========================

// Container  
var imageLoader:Loader = new Loader();

// Url Requests  
var imageRequest:URLRequest = new URLRequest(“01.swf”);  
var imageRequest02:URLRequest = new URLRequest(“02.swf”);

// Intial Page Loaded  
imageLoader.load(imageRequest)  
addChild(imageLoader)

// Button Functions  
function goHome (e:MouseEvent):void{  
imageLoader.load(imageRequest)  
addChild(imageLoader)  
}  
home\_btn.addEventListener(MouseEvent.CLICK, goHome);

function go02 (e:MouseEvent):void{  
imageLoader.load(imageRequest02);  
addChild(imageLoader);  
}  
btn\_02.addEventListener(MouseEvent.CLICK, go02);

=========================

Many thanks in advance!
