# Load and unload SWF with FLV

**URL:** <https://forum.kirupa.com/t/load-and-unload-swf-with-flv/292384>\
**Category:** Uncategorized\
**Created:** [July 13, 2009, 8:27pm UTC](https://forum.kirupa.com/t/load-and-unload-swf-with-flv/292384 "2009-07-13T20:27:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![i037leo](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@i037leo](https://forum.kirupa.com/u/i037leo)\
**Post date:** [July 13, 2009, 8:27pm UTC](https://forum.kirupa.com/t/load-and-unload-swf-with-flv/292384/1 "2009-07-13T20:27:18Z")

</div>

Hi, I’m pretty new here and have been banging my head against the wall for awhile on this one. Here is the issue. I’ve got a SWF with two (for now) buttons on it that each load a SWF. Each of these will load fine _if they are the first one pressed_. Once one is pressed there are problems. If you try to go to the next one, the new SWF covers the one currently playing, but it will not load the FLV associated with it and the audio from the previous does not stop. You can see it all here:

[http://friendlyjoe.com/demos.html](http://friendlyjoe.com/demos.html)

And here is the code on the navigation:

var Xpos:Number = 130;  
var Ypos:Number = 10;  
var swf:MovieClip;  
var loader:Loader = new Loader();

loader.x = Xpos;  
loader.y = Ypos;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Btns Universal function  
function btnClick(event:MouseEvent):void {

loader.unload();  
var newSWFRequest:URLRequest = new URLRequest(“[http://friendlyjoe.com/flash/swf/](http://friendlyjoe.com/flash/swf/)” + event.target.name + “.swf”);  
loader.load(newSWFRequest);  
loader.x = Xpos;  
loader.y = Ypos;  
addChild(loader);  
}  
// Btn listeners  
safelift.addEventListener(MouseEvent.CLICK, btnClick);  
gamestore.addEventListener(MouseEvent.CLICK, btnClick);

Any help would be greatly appreciated.

Thanks!
