External swf wont stop playing sound
I have created a form that has some buttons that open external swf files. Problem is when I close the external swf the audio keeps playing. If I turn off sounds the sound starts again when I load a new external swf. Here is the relevant portion of code;
function playMyMovie():void{
myrequest=new URLRequest(myMovie);
myloader =new Loader();
myloader.load(myrequest);
function movieLoaded(myevent:Event):void {
stage.addChild(myloader);
var mycontent:MovieClip=myevent.target.content;
mycontent.x=100;
mycontent.y=50;
}
myloader.contentLoaderInfo.addEventListener(Event.COMPLETE, movieLoaded);
}
function removeMovie(myevent:MouseEvent):void {
myloader.unloadAndStop();
exitBtn.visible =false;
playingMovie=false;
}
Any suggestions would be appreciated.