# Sound code, finishing touch

**URL:** <https://forum.kirupa.com/t/sound-code-finishing-touch/47628>\
**Category:** Uncategorized\
**Created:** [April 5, 2004, 10:15pm UTC](https://forum.kirupa.com/t/sound-code-finishing-touch/47628 "2004-04-05T22:15:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghjr](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@ghjr](https://forum.kirupa.com/u/ghjr)\
**Post date:** [April 5, 2004, 10:15pm UTC](https://forum.kirupa.com/t/sound-code-finishing-touch/47628/1 "2004-04-05T22:15:26Z")

</div>

Everything except for the resume button on my sound player doesn’t work. The stop works fine, but it doesn’t seem to start back up again when I press the resume.

Here is the code:

\*\*

s = new Sound();  
s.loadSound(“teste.mp3”,true);

acao = “desligar”

\_root.onEnterFrame = function () {

//TURN OFF

if (acao==“desligar”) {  
controleSom\_button.onPress = function () {  
cue = Math.round(s.position/1000);  
s.stop();  
\_root.controleSom\_button.gotoAndStop(2);  
acao = “ligar”  
}  
}

//TURN ON (RESUME)

if (acao==“ligar”) {  
controleSom\_button.onPress = function () {  
s.start(cue,1);  
\_root.controleSom\_button.gotoAndStop(1);  
acao = “desligar”  
trace (cue);  
}

}  
}

\*\*

Thanks!! :thumb:
