# onSoundCompleted problem

**URL:** <https://forum.kirupa.com/t/onsoundcompleted-problem/16574>\
**Category:** Uncategorized\
**Created:** [March 26, 2003, 12:11pm UTC](https://forum.kirupa.com/t/onsoundcompleted-problem/16574 "2003-03-26T12:11:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![j\_mcc99](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/j_mcc99/32/71_2.png) [@j\_mcc99](https://forum.kirupa.com/u/j_mcc99)\
**Post date:** [March 26, 2003, 12:11pm UTC](https://forum.kirupa.com/t/onsoundcompleted-problem/16574/1 "2003-03-26T12:11:08Z")

</div>

I’m having a problem with a movie. To simplify things there’s a main movie and there’s a movie loaded into an empty movieclip on main.

The loaded clip has a sound loaded into a sound object:  
\_root.mySound = new Sound();  
\_root.mySound.attachSound(“clip1”);  
\_root.mySound.start;

The problem is when I call the onSoundCompleted method. Looks like this:

\_root.mySound.onSoundComplete = function(){  
if(\_root.chkAutoPlay.getValue == true){  
\_root.twoSeconds.play();  
}  
}

It checks the value of a checkbox on the main movie. If the checkbox is checked then \_root.twoSeconds is played (which loads another sound clip after a 2 second pause). My problem is that regardless of the checkboxs value the onSoundCompleted method is called on.

Am I getting the checked value of my checkbox correctly? Is there another value that I should be taking?

---

<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:** [March 26, 2003, 12:58pm UTC](https://forum.kirupa.com/t/onsoundcompleted-problem/16574/2 "2003-03-26T12:58:33Z")

</div>

there’s a little mistake in your script…

```auto
_root.mySound.onSoundComplete = function(){
if(_root.chkAutoPlay.getValue() == true){
_root.twoSeconds.play();
}
}

```

=)

---

<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:** [March 26, 2003, 1:15pm UTC](https://forum.kirupa.com/t/onsoundcompleted-problem/16574/3 "2003-03-26T13:15:47Z")

</div>

BOOYEAH!!

Thanks kax, I needed a fresh pair of eyes. Works fine now.

---

<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:** [March 26, 2003, 1:18pm UTC](https://forum.kirupa.com/t/onsoundcompleted-problem/16574/4 "2003-03-26T13:18:17Z")

</div>

😛

yup… no problem 😉 =)
