SoundMixer.stopAll(); - kill audio in loaded SWF
Hi,
I've currently got a flash site written in AS3, into which i'm loading an AS2 SWF that plays audio.
The AS2 SWF is loaded into a container movieclip at Frame 10, when a specific navigation button is pressed, the playhead advances to this frame, and calls the SWF. When the user navigates away from this frame, SoundMixer.stopAll(); is called to kill the audio from the loaded AS2 SWF.
This works fine inside of Flash however, when deployed to the browser, the audio playing in the loaded AS2 SWF carries on playing.
I've tried loading a new blank SWF in it's place to kill the audio, as well as a blank SWF with stopAll(), all of these solutions work within the Flash IDE (CS4) however the audio always persists in the browser.
Does anyone know of a method i can use to kill the audio here??
Code is really simple:
Code:
var swfLoader:Loader = new Loader();
holderMC.addChild(swfLoader);
var bgURL:URLRequest = new URLRequest("ytPlayer.swf");
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
swfLoader.load(bgURL);
function loadProdComplete(e:Event):void {
trace("file loaded");
}
unloadBTN.addEventListener(MouseEvent.MOUSE_DOWN, unloadPressed);
function unloadPressed(evt:Event){
var bgURL:URLRequest = new URLRequest("stopsounds.swf");
swfLoader.load(bgURL);
SoundMixer.stopAll();
}
I'm racking my brain trying to find a solution to what should be a simple problem but i can find none.
Any help here would be much appreciated, i really need to find an answer to this problem. :confused:
Thanks.