# (F5) Changing sounds via a button?

**URL:** <https://forum.kirupa.com/t/f5-changing-sounds-via-a-button/10927>\
**Category:** flash\
**Created:** [January 9, 2003, 4:01pm UTC](https://forum.kirupa.com/t/f5-changing-sounds-via-a-button/10927 "2003-01-09T16:01:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToddziLLa](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@ToddziLLa](https://forum.kirupa.com/u/ToddziLLa)\
**Post date:** [January 9, 2003, 4:01pm UTC](https://forum.kirupa.com/t/f5-changing-sounds-via-a-button/10927/1 "2003-01-09T16:01:19Z")

</div>

I am making a website, and have 5 loops that I would like to use. I need a button that will change between those 5 loops. How do I do that?

I also need a button that will mute and unmute all sounds. How do I do that?

Thanks

ToddziLLa

---

<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:** [January 9, 2003, 6:12pm UTC](https://forum.kirupa.com/t/f5-changing-sounds-via-a-button/10927/2 "2003-01-09T18:12:28Z")

</div>

You have to link the sounds before you can dynamically use them. Import the 5 sounds and right-click each one in the library. Select “Linkage”. Select “Export this symbol” and type a unique name in the Identifier text box for each sound. Now, you can manipulate the sounds via ActionScript.

the action script would look something like this:

mySound = new Sound(); // creates a Sound object  
mySound.attachSound(‘theLinkageIdentifierHere’); // attaches the sound to the sound object  
mySound.start(); // starts the sound  
mySound.stop(); // stops the sound  
mySound.setVolume(50); // sets volume to 50 percent

You can use the attachSound method to assign a different sound to the sound object. There are some other neat sound manipulations, but this is a start.
