A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: SoundMixer.stopAll(); - kill audio in loaded SWF

  1. #1
    Senior Member
    Join Date
    Jun 2001

    Question SoundMixer.stopAll(); - kill audio in loaded SWF


    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:

    var swfLoader:Loader = new Loader();
    var bgURL:URLRequest = new URLRequest("ytPlayer.swf");
    swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
    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");
    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.


  2. #2
    Senior Member
    Join Date
    Jun 2001
    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!


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

Click Here to Expand Forum to Full Width

HTML5 Development Center