Skip to main content
Participant
August 30, 2014
Question

Soundboard Help

  • August 30, 2014
  • 1 reply
  • 177 views

Im Making a Soundboard and a feature I wanted to add was a stop all sounds button for ActionScript 3 and I'm having trouble getting the button to work properly. The button is simply stop a sound being played after sound was clicked on. Any help on the script to create this is greatly appreciated (Yep, I'm a noob to actionscripts)

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
August 31, 2014

are you looking for code to 'prevent' future sounds from playing?

if so, you'll need to code that yourself.  a basic boolean would work:

var allowSounds:Boolean = true;

your_mute_toggle_btn.addEventListener(MouseEvent.CLICK,muteF);

function muteF(e:MouseEvent):void{

allowSounds=!allowSounds;

}

//then every place you have code to play a sound, eg

sc=whatever.play();

//use

if(allowSound){

sc=whatever.play();

}