# \[flashMX\] onSoundComplete... help!

**URL:** <https://forum.kirupa.com/t/flashmx-onsoundcomplete-help/22629>\
**Category:** flash\
**Created:** [June 6, 2003, 11:31am UTC](https://forum.kirupa.com/t/flashmx-onsoundcomplete-help/22629 "2003-06-06T11:31:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariam](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@mariam](https://forum.kirupa.com/u/mariam)\
**Post date:** [June 6, 2003, 11:31am UTC](https://forum.kirupa.com/t/flashmx-onsoundcomplete-help/22629/1 "2003-06-06T11:31:29Z")

</div>

i have a sound file on the first frame of my movie. the sound starts playing right off. It is a 7sec story. I want the sound to finish before playing the next frame. This is the code i’m using.

sd = new Sound();  
sd.attachSound(“philSound”);  
sd.onSoundComplete = function() {  
gotoAndPlay(“wow”);  
}

It doesn’t work. I have linked the sound file in the library and given it the linkage id of “philSound”  
I’d appreciate any help with this.  
thanks  
maria

---

<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:** [June 6, 2003, 12:29pm UTC](https://forum.kirupa.com/t/flashmx-onsoundcomplete-help/22629/2 "2003-06-06T12:29:15Z")

</div>

you attached the song but you didn’t play it. Of course it won’t detect when it’s finish 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:** [June 6, 2003, 3:03pm UTC](https://forum.kirupa.com/t/flashmx-onsoundcomplete-help/22629/3 "2003-06-06T15:03:38Z")

</div>

[AS]  
sd = new Sound();  
sd.attachSound(“philSound”);  
sd.start(0,1);  
sd.onSoundComplete = function() {  
gotoAndPlay(“wow”);  
}  
[/AS]

there ya go

---

<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:** [June 7, 2003, 7:51am UTC](https://forum.kirupa.com/t/flashmx-onsoundcomplete-help/22629/4 "2003-06-07T07:51:08Z")

</div>

yes it worked!! thankyou thankyou. It’s magic.

---

<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:** [June 7, 2003, 5:14pm UTC](https://forum.kirupa.com/t/flashmx-onsoundcomplete-help/22629/5 "2003-06-07T17:14:07Z")

</div>

lol good, glad it worked, but now you should look into externaly loading sounds. much better option…

---

<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:** [June 7, 2003, 5:33pm UTC](https://forum.kirupa.com/t/flashmx-onsoundcomplete-help/22629/6 "2003-06-07T17:33:11Z")

</div>

ya, he’s right! much better if u use load external files  
just change the attachSound to  
sd.loadSound(“philSound.mp3”,true)  
where the song named philSound in the same folder as the swf
