On / Off audio button

Gentlemen

I wish to create a button to shut up background sound of a movie ; as thousand of pages in the web movie will load with background loop sound playing ;
if visitors get bored with same sound looping then there will be shut up button ; another button will put the sound playing back.
Code bellow it´s a Kirupa´s tut. picked somewhere here and has the inconvenience to start the same sound many times.

on (release) {
&nbsp &nbsp &nbsp &nbsp mmktSound = new Sound(this);
&nbsp &nbsp &nbsp &nbsp mmktSound.attachSound(“clavinet_loop”);
&nbsp &nbsp &nbsp &nbsp mmktSound.start(0, 99);
}

Perhaps with some changings it could fit to my purposes.
Once again thank you a lot for all the help.
Regards
MMKT

Well you need a toggle so it shouldn’t be too hard. I know I saw a really good toggle today but I can’t seem to find it, so I’ll just go with something a little longer. :slight_smile:

place this in frame one of the movie

mmktSound = new Sound(this);
mmktSound.attachSound(“clavinet_loop”);
mmktSound.start(0, 99);
soundToggle=true;

have your button simply toggle

on (release) {
if(soundToggle!=true){
mmktSound.start(0,99);
soundToggle=true;
}else{
mmktSound.stop();
soundToggle=false;
}
}

Being such an ingeniously brilliant man, I answered this question earlier. My answer worked for Chooku, so it should word for you…:

<a href = “http://pub40.ezboard.com/fkirupafrm8.showMessage?topicID=2874.topic”>It’s right here.</a>

Great !
Thank you I will try your code.
MMKT