Back to Scripts page
Click in the text area below, select all and copy to grab the script
Script listing:
<HTML> <HEAD> <TITLE>Sound controller</TITLE> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"> <!-- Hide script from old browsers function startSound() { document.mySound.play(false) } function pauseSound() { document.mySound.pause() } function stopSound() { document.mySound.stop() } function changeVol(changeBy) { currentVol = document.mySound.GetVolume() if (currentVol < 100 && currentVol > 0) { document.mySound.setvol(currentVol+changeBy) } } // End hiding script from old browsers --> </SCRIPT> </HEAD> <BODY BGCOLOR=WHITE> <EMBED SRC="jurassic.wav" NAME="mySound" MASTERSOUND AUTOSTART=NO HIDDEN=TRUE> <CENTER> <H1>Sound Controls</H1> <FORM> <INPUT TYPE=BUTTON VALUE="Vol +" onClick="changeVol(10)"> <INPUT TYPE=BUTTON VALUE="Vol -" onClick="changeVol(-10)"> <INPUT TYPE=BUTTON VALUE="Start" onClick="startSound()"> <INPUT TYPE=BUTTON VALUE="Pause" onClick="pauseSound()"> <INPUT TYPE=BUTTON VALUE="Stop" onClick="stopSound()"> </FORM> </CENTER> </BODY> </HTML>