Skip to main content
Participant
May 21, 2014
Answered

Stop sound upon frame exit

  • May 21, 2014
  • 1 reply
  • 361 views

Good day all,

I am working on a mobile app for video streaming. I have video loading on a frame, upon exit to different frame, sound keeps playing. Looks like SoundMixer.stopAll(); is not working.

Regards

This topic has been closed for replies.
Correct answer Colin Holgate

The audio in a net stream is not a regular Sound object, and so you can’t stop the sound using the sound mixer. You should be able to stop the stream like this:

ns.stop();

where ns would be your NetStream variable.

1 reply

Participant
May 26, 2014

Really? No one else has video and sound persisting after navigating away from the frame housing the media asset? Onwards to Titanium ...

Colin Holgate
Colin HolgateCorrect answer
Inspiring
May 26, 2014

The audio in a net stream is not a regular Sound object, and so you can’t stop the sound using the sound mixer. You should be able to stop the stream like this:

ns.stop();

where ns would be your NetStream variable.

Participant
May 27, 2014

Thank you Colin. I reconfigured to stop video playback altogether upon frame exit, because the sound would stop with your code snippet, but I suspect the video would still be streaming. Users would therefore incur higher 3G data costs. This worked for me.

--------------------------------------------------------------------------------------------------------------

//GoTo  Channel Guide

btn_back_HOME.addEventListener(MouseEvent.CLICK,fl_BackHOME);

function fl_BackHOME(event:MouseEvent):void

{

    tv1.addEventListener(Event.REMOVED_FROM_STAGE, stopPlay);

    function stopPlay(e:Event)

{

      tv1.stop();

}

    gotoAndStop("home");

}

--------------------------------------------------------------------------------------------------------------

Kind regards