# Play Sounds only when play button press

**URL:** <https://forum.kirupa.com/t/play-sounds-only-when-play-button-press/331734>\
**Category:** flash\
**Created:** [October 8, 2013, 11:23pm UTC](https://forum.kirupa.com/t/play-sounds-only-when-play-button-press/331734 "2013-10-08T23:23:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bracelett](https://avatars.discourse-cdn.com/v4/letter/b/ac8455/32.png) [@bracelett](https://forum.kirupa.com/u/bracelett)\
**Post date:** [October 8, 2013, 11:23pm UTC](https://forum.kirupa.com/t/play-sounds-only-when-play-button-press/331734/1 "2013-10-08T23:23:20Z")

</div>

I want on first load of SWF to be the music is Off, when the play button press, thats the time the music will play.  
On my timeline I have two Layers, for action and the 2nd layer is for the buttons ON / OFF.

Here is my Script:  
on my first frame under script layer I put this: stop();  
on the second frame I put this: stopAllSounds();

on my play button I put this:

```auto

on(release){	prevframe();
}

```

on my pause button I put this:

```auto
on(release){
	nextframe();
}

```

Any help will be appreciated!
