Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple - Sound on/Sound off

Status
Not open for further replies.

jbezzina

MIS
May 4, 2004
46
MT
I have added an image on the main page and added the following script to it:

on (press) {
stopSound("music.mp3");
sound = "off";
}
on (press) {
if (sound = "off") {
}
playSound("music.mp3");
sound = "on";
}

The idea is to stop the music that is preloaded once this image is pressed. Once the music is off, I would like to have it start again if the user presses the image again.

This is not working, and the varable is being set to "on" as soon as I press the button. The music does stop :) but it does not start again :(

Help !!! Thanks !!

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top