# On / Off audio button

**URL:** https://forum.kirupa.com/t/on-off-audio-button/2432
**Category:** flash
**Created:** [April 3, 2002, 6:06am UTC](https://forum.kirupa.com/t/on-off-audio-button/2432 "2002-04-03T06:06:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 3, 2002, 6:06am UTC](https://forum.kirupa.com/t/on-off-audio-button/2432/1 "2002-04-03T06:06:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 3, 2002, 6:48am UTC](https://forum.kirupa.com/t/on-off-audio-button/2432/2 "2002-04-03T06:48:26Z")

</div>

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. 🙂

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;  
}  
}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 3, 2002, 6:08pm UTC](https://forum.kirupa.com/t/on-off-audio-button/2432/3 "2002-04-03T18:08:16Z")

</div>

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](http://pub40.ezboard.com/fkirupafrm8.showMessage?topicID=2874.topic)”\>It’s right here.\</a\>

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 4, 2002, 2:19am UTC](https://forum.kirupa.com/t/on-off-audio-button/2432/4 "2002-04-04T02:19:01Z")

</div>

Great !  
Thank you I will try your code.  
MMKT
