-
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.
Thanks.
-
As an update, i've successfully implemented soundtransform to kill the audio of the container clip using holderMC.soundTransform = new SoundTransform(0,0);
however when i try and unload the swf, the audio returns?! any ideas on the final hurdle would be freaking awesome!
thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|