# Identifiers - sound

**URL:** <https://forum.kirupa.com/t/identifiers-sound/185666>\
**Category:** Uncategorized\
**Created:** [April 15, 2006, 2:18am UTC](https://forum.kirupa.com/t/identifiers-sound/185666 "2006-04-15T02:18:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freeseus](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@Freeseus](https://forum.kirupa.com/u/Freeseus)\
**Post date:** [April 15, 2006, 2:18am UTC](https://forum.kirupa.com/t/identifiers-sound/185666/1 "2006-04-15T02:18:26Z")

</div>

okay… I’m using FXdown.wav as a sound effect when you move over a button. I’m calling for it by means of actionscript (instead of putting the sound in an actual frame). The identifier for the FXdown.wav is buttonSound.

this.onRollOver = function(){  
menuSound = new Sound(this);  
menuSound.attachSound(“buttonSound”);  
menuSound.start(0, 1);  
rewind = false;  
play();  
}

I want to be able to disable the sound effect FXdown.wav throughout the entire page by clicking another button on the flash page.

Should I change the identifier of FXdown.wav via a click? If so, does anyone have the AS for that? Or, what’s the best way to do this?

PS… I only want FXdown.wav to be disabled throughout the page, not all sounds ie stopAllSounds();

And, I must be able to re-enable it by clicking another button.

---

<div class="post-metadata">

**Author:** ![Freeseus](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@Freeseus](https://forum.kirupa.com/u/Freeseus)\
**Post date:** [April 15, 2006, 2:50am UTC](https://forum.kirupa.com/t/identifiers-sound/185666/2 "2006-04-15T02:50:56Z")

</div>

I figured out a lame way to do it… but there’s gotta be a simple line of code for this.

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 15, 2006, 3:29am UTC](https://forum.kirupa.com/t/identifiers-sound/185666/3 "2006-04-15T03:29:44Z")

</div>

menuSound.stop(“buttonSound”);

---

<div class="post-metadata">

**Author:** ![Freeseus](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@Freeseus](https://forum.kirupa.com/u/Freeseus)\
**Post date:** [April 15, 2006, 3:36am UTC](https://forum.kirupa.com/t/identifiers-sound/185666/4 "2006-04-15T03:36:57Z")

</div>

I need to clarify something I guess. The sound is not active until you move your mouse over a button.

So stopping the sound doesn’t do anything. I need to stop it’s ability to call the sound by clicking a button. And then be able to reactive it by using another button.

---

<div class="post-metadata">

**Author:** ![Freeseus](https://avatars.discourse-cdn.com/v4/letter/f/9e8a1a/32.png) [@Freeseus](https://forum.kirupa.com/u/Freeseus)\
**Post date:** [April 15, 2006, 3:40am UTC](https://forum.kirupa.com/t/identifiers-sound/185666/5 "2006-04-15T03:40:44Z")

</div>

I could do something like this:

on(press){  
\_root.AB.unloadMovie();  
}

AB is a movieclip on the main timeline that contains the .wav file.

However, once I’ve unloaded that movieclip, I don’t know how to get it to reappear. It’s like a permanent “off button” for that .wav sound.

\_root.AB.loadMovie() doesn’t work

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 15, 2006, 3:42am UTC](https://forum.kirupa.com/t/identifiers-sound/185666/6 "2006-04-15T03:42:03Z")

</div>

> [@Freeseus](#):
>
> I need to clarify something I guess. The sound is not active until you move your mouse over a button.
> 
> So stopping the sound doesn’t do anything. I need to stop it’s ability to call the sound by clicking a button. And then be able to reactive it by using another button.

Alright, then call the Sound.stop method when you press the button . . .

---

<div class="post-metadata">

**Author:** ![devonair](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@devonair](https://forum.kirupa.com/u/devonair)\
**Post date:** [April 15, 2006, 3:47am UTC](https://forum.kirupa.com/t/identifiers-sound/185666/7 "2006-04-15T03:47:01Z")

</div>

something like this:  
[AS]var playMenuSound:Boolean = true;  
//  
var menuSound:Sound = new Sound(this);  
menuSound.attachSound(“buttonSound”);  
//  
some\_mc.onRollOver = function() {  
if (playMenuSound) {  
menuSound.start();  
}  
rewind = false;  
this.play();  
};  
//  
toggleMenuSound\_mc.onRelease = function() {  
playMenuSound = !playMenuSound;  
};[/AS]
