# Sound code, finishing touch

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

---

<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:** [April 7, 2004, 3:30am UTC](https://forum.kirupa.com/t/sound-code-finishing-touch/106436/2 "2004-04-07T03:30:57Z")

</div>

> [@scotty](#):
>
> Did you test it “on line”. The “pause” thing isn’t working in flashplayer.
> 
> scotty(-:

Ah-ha! That’s probably it… I’ll test it out when I get the chance.

Thanks scotty!! :beam:

---

<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:** [April 7, 2004, 10:03am UTC](https://forum.kirupa.com/t/sound-code-finishing-touch/106436/3 "2004-04-07T10:03:59Z")

</div>

You’re welcome:)
