PDA

View Full Version : background sound and button sounds



paisley
August 8th, 2003, 01:35 PM
I made 2 sounds: background and button sound.

This is the code:

_root.onLoad = function() {
backgroundSound = new Sound(this);
backgroundSound.attachSound("sound_root");
backgroundSound.start();
buttonSound = new Sound(button0);
buttonSound.attachSound("sound_button");
}
_root.onEnterFrame = function() {
backgroundSound.onSoundComplete(backgroundSound.st art());
}
button0.onRelease = function() {
buttonSound.start();
}


The problem is the background sound plays but when I click on the button, the button sound doesn't play.

Did I do something wrong?

Help, please. Thanks

Keith130
August 8th, 2003, 04:25 PM
try


button0.onRelease = function() {
button0.buttonSound.start();
}

paisley
August 8th, 2003, 05:04 PM
It didn't work. Any other suggestions?

fluid_0ne
August 8th, 2003, 05:25 PM
should work :
_root.onLoad = function() {
backgroundSound = new Sound(this);
backgroundSound.attachSound("sound_root");
backgroundSound.start();
buttonSound = new Sound(this);
buttonSound.attachSound("sound_button");
}
_root.onEnterFrame = function() {
backgroundSound.onSoundComplete(backgroundSound.st art());
}
button0.onRelease = function() {
buttonSound.start();
}