# Sound tutorial

**URL:** <https://forum.kirupa.com/t/sound-tutorial/8660>\
**Category:** Uncategorized\
**Created:** [November 26, 2002, 2:40am UTC](https://forum.kirupa.com/t/sound-tutorial/8660 "2002-11-26T02:40:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chalkboard2](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@chalkboard2](https://forum.kirupa.com/u/chalkboard2)\
**Post date:** [November 26, 2002, 2:40am UTC](https://forum.kirupa.com/t/sound-tutorial/8660/1 "2002-11-26T02:40:47Z")

</div>

yeah i was workin through this tutorial: [http://www.kirupa.com/developer/actionscript/sound.asp](http://www.kirupa.com/developer/actionscript/sound.asp)

…and i was gettin the sounds to work with the play button, but i dont know how to stop the sound! hah if you could help me out that would be great.

---

<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:** [November 26, 2002, 2:47am UTC](https://forum.kirupa.com/t/sound-tutorial/8660/2 "2002-11-26T02:47:42Z")

</div>

stopAllSounds()

That is the command to stop the sounds playing 🙂

---

<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:** [November 26, 2002, 12:22pm UTC](https://forum.kirupa.com/t/sound-tutorial/8660/3 "2002-11-26T12:22:59Z")

</div>

ok i added that action to the stop button and this came up when i tested the movie

Scene=Scene 1, Layer=Layer 16, Frame=30: Line 1: Statement must appear within on handler  
stopAllSounds();

do you know what i did wrong?

---

<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:** [November 26, 2002, 1:26pm UTC](https://forum.kirupa.com/t/sound-tutorial/8660/4 "2002-11-26T13:26:11Z")

</div>

you have to put it with and “on” handler:  
for example:

**on(release) {**  
stopAllSounds();  
**}**

release executes the action when the user releases the mouse button. press does it when the user presses… etc.

---

<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:** [November 26, 2002, 4:42pm UTC](https://forum.kirupa.com/t/sound-tutorial/8660/5 "2002-11-26T16:42:57Z")

</div>

hah, i cant believe i forgot that. thanks

---

<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:** [November 26, 2002, 7:41pm UTC](https://forum.kirupa.com/t/sound-tutorial/8660/6 "2002-11-26T19:41:29Z")

</div>

real quick question, lets say i wanted the song to fade in as i hit play, and to fade out when i hit stop…how would i go about doing that?
