# Unloading a swf in player 9?

**URL:** <https://forum.kirupa.com/t/unloading-a-swf-in-player-9/305452>\
**Category:** Uncategorized\
**Created:** [February 25, 2010, 4:37pm UTC](https://forum.kirupa.com/t/unloading-a-swf-in-player-9/305452 "2010-02-25T16:37:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelafoley](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@michaelafoley](https://forum.kirupa.com/u/michaelafoley)\
**Post date:** [February 25, 2010, 4:37pm UTC](https://forum.kirupa.com/t/unloading-a-swf-in-player-9/305452/1 "2010-02-25T16:37:45Z")

</div>

I can’t seen to get my swf vidio that i am importing into my main swf to stop. the sound continues after i unload(). Why? My code is:

var loader:Loader = new Loader();  
var newSWFRequest:URLRequest = new URLRequest(“video1.swf”);

button.addEventListener(MouseEvent.CLICK, loadVideo);  
function loadVideo(event:MouseEvent):void {

```
loader.load(newSWFRequest);
loader.x = 100;
loader.y = 100;
addChild(loader);
loader.unload();

```

}

home\_btn.addEventListener(MouseEvent.CLICK, killVideo);   
function killVideo(event:MouseEvent):void {

```
loader.unload();
removeChild(loader);

```

}
