PDA

View Full Version : On-Off toggle button


r2d2
08-22-2003, 07:23 PM
Hi there!,

I'm clue less in this thing of programing.

I've tried to build an on off button for sound, but my code so far does one thing or the other.

This is what I did:

on (release) {
bgSound.stop("sound1"), stop()
or
bgSound.start("sound1");
}

Thanks

Adrenaline
08-22-2003, 09:03 PM
check this site out:
http://www.macromedia.com/support/flash/ts/documents/simple_sound.htm

r2d2
08-23-2003, 04:50 PM
Hey thanks for the tip!!

I checked out the page but it is for different buttons, I´m trying to make this thing work on a single button.

Anyway thanks again!!

chris-sharpe99
08-24-2003, 09:00 PM
you need to use a variable, something like playing=true; and check it with a condition. If it is true, stop the sound, if it is false then start the sound.

r2d2
09-05-2003, 01:42 PM
Thanks for the tip, I´ll let you know.

webguy
09-05-2003, 02:30 PM
here is a simple toggle for true::false


mc.onRelease = function () {
value = !value;
}


web