Back to Scripts page
Click in the box below, select all and copy to grab the script
<HTML> <HEAD> <TITLE>Sound controller</TITLE> <SCRIPT LANGUAGE=JAVASCRIPT> <!-- Hide script from old browsers // This script copyright 1997, Tom Negrino and Dori Smith. // This script is from "JavaScript for the WWW, Visual QuickStart Guide, 2nd Ed." // For more information, see <http://www.chalcedony.com/javascript/>. // This script may be used and modified, but the copyright notice must remain intact. 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="javascript:changeVol(10)"> <INPUT TYPE="button" VALUE="Vol -" onClick="javascript:changeVol(-10)"> <INPUT TYPE="button" VALUE="Start" onClick="javascript:startSound()"> <INPUT TYPE="button" VALUE="Pause" onClick="javascript:pauseSound()"> <INPUT TYPE="button" VALUE="Stop" onClick="javascript:stopSound()"> </FORM> </CENTER> </BODY> </HTML>