# Sound button

**URL:** <https://forum.kirupa.com/t/sound-button/270438>\
**Category:** Uncategorized\
**Created:** [September 9, 2008, 10:37pm UTC](https://forum.kirupa.com/t/sound-button/270438 "2008-09-09T22:37:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spark067](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@spark067](https://forum.kirupa.com/u/spark067)\
**Post date:** [September 9, 2008, 10:37pm UTC](https://forum.kirupa.com/t/sound-button/270438/1 "2008-09-09T22:37:31Z")

</div>

Hello everyone,

I am making a flash that has three sound buttons. I have 80 frames animation before three sound buttons. I wrote actionscript like this.

var loadSnd:URLRequest = new URLRequest(“SORTER.mp3”);  
var thisSnd:Sound = new Sound();  
var sndTrans:SoundChannel = new SoundChannel();

thisSnd.load(loadSnd);

```
play_btn.addEventListener(MouseEvent.CLICK, playF);
stop_btn.visible = false;
stop_btn.addEventListener(MouseEvent.CLICK, stopF);

```

function playF(event:MouseEvent):void{  
SoundMixer.stopAll();  
sndTrans = thisSnd.play();  
play\_btn.visible = false;  
stop\_btn.visible = true;  
}

function stopF(event:MouseEvent):void{  
sndTrans.stop();  
stop\_btn.visible = false;  
play\_btn.visible = true;  
}

Where I put the three sound button script?  
Looks like really simple but I can’t figure it out.

Any help would be greatly appreciated.

Thanks,
