# Audio on and off for complete flash movie

**URL:** https://forum.kirupa.com/t/audio-on-and-off-for-complete-flash-movie/182267
**Category:** flash
**Created:** [March 16, 2006, 7:20pm UTC](https://forum.kirupa.com/t/audio-on-and-off-for-complete-flash-movie/182267 "2006-03-16T19:20:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lolomedia](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lolomedia](https://forum.kirupa.com/u/lolomedia)
#### Post date: [March 16, 2006, 7:20pm UTC](https://forum.kirupa.com/t/audio-on-and-off-for-complete-flash-movie/182267/1 "2006-03-16T19:20:21Z")

</div>

I need to turn my audio off with a simple button and back on with the same one, the audio from all the movies attached to the main movie should be off when I press this button

```auto

bgSound = new Sound(this);
itquit = false;
itgoes = true;
bgSound.attachSound("sound1");
bgSound.start(0.99);
Btn_Mute.onPress = function()
{
 if (bgSound.getVolume() != 0)
 {
  Btn_Mute.gotoAndPlay(2);
  oldVolume = bgSound.getVolume();
  bgSound.setVolume(0);
 }
 else
 {
  Btn_Mute.gotoAndPlay(1);
  bgSound.setVolume(oldVolume);
 }
};

```

this is what i have but its not working.  
i have different .wav throughout my flash and my button is correct, is called Btn\_Mute.

please help.

thank you.
