PDA

View Full Version : problem with soubnd controlling


toh
09-16-2002, 05:27 PM
i create a button to start and stop the song.
the scripts is :

song = new Sound();
song.attachSound("my_song");
count = 0;
option = "Start";
_root.playButton.onRelease = function() {
count++;
if (count%2 != 0) {
song.start();
option = "Stop";
} else {
song.stop();
option = "Start";
}
};

its ok at first, but when i add a movie clip in a new layer, its not functioning quite right.

can someone please tell me whats the problem???

THANKS!!!

farafiro
09-17-2002, 06:29 AM
hey toh
welcome to the forums
I wonder why u r using a condition "if (count%2 != 0)", for playing the sound??, also notice that by adding the code "counter++" to a button, it will only be increased by 1 everytime u press the button.

toh
09-17-2002, 10:57 AM
the (count % 2) is actually for finding odd or even.

i already discovered the problem after looking the tutorial for sound controlling at flashkit.

im still new in flash and i realise that programming in flash is quite different from other programming.

Anyway, Thanks !