onSoundCompleted problem

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?

there’s a little mistake in your script…

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

=)

BOOYEAH!!

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

:stuck_out_tongue:

yup… no problem :wink: =)