PDA

View Full Version : Sound Help


space
10-12-2006, 06:27 PM
Hello all,

I have a problem with my sound code. The code works and toggles the play and pause fine. But when the sound ends I would like the button to be able to play the sound again. It seems as though the onSoundComplete() function is not being invoked, can someone help with this?

Below is my button code.

on(release) {

SoundPosition=_root.firstSound.position/1000;
if (_root.playing!=true) {
if (SoundPosition==null) {
SoundPosition=0;
}


_root.firstSound.start(SoundPosition,0);
_root.playing=true;
} else {
if (_root.playing==true) {

_root.firstSound.stop();
_root.playing=false;
}
_root.firstSound.onSoundComplete = function() {

_root.playing=false;

}
}

}

I am in urgent need to solve this, anyone who can help it would be greatly appreciated.

Flash Gordon
10-12-2006, 08:47 PM
just though it was interesting to note that your last (and only other) post was 2.5 years......

anonymous
10-13-2006, 02:46 AM
Take the function out of your button script...

_root.firstSound.onSoundComplete = function() {
//_root.playing=false;
_root.firstSound.start(0,1);
};