View Full Version : Music on/off


Tom.T.
12-21-2002, 09:29 PM
Does anyone know where a can find some type of script that starts with music playing and a small image button with off then click that music stops *thinks yeh well dhh* and an on button replaces it

well you know what i mean =P

Thanks
Tom =)

Tom.T.
12-22-2002, 01:03 AM
after ours of looking i finaly got it

ill post it here incase anyone els needs one =P

<script language="JavaScript"><!--
function musicOff() {
document.midi.stop()
}
function musicOn() {
document.midi.play()
}
function changeButton() {
if (document.onoff.B1.value=='Turn music off') {
document.onoff.B1.value='Turn music on';
musicOff()
}
else {
document.onoff.B1.value='Turn music off';
musicOn()
}
}
//-->
</script><embed name="midi" src="heartshapedbox.mid" width="128" height="128" hidden>
<form name="onoff">
<input type="button" value="Turn music off" name="B1" onClick="changeButton()" style="color: #FFFFFF; background-color: #6699FF; font-family: Tahoma; font-size: 10pt">
</form>

it actually works to, im gona change the button to an image though

Thanks anyway peeps
Tom =)

mashacealde
01-22-2003, 04:39 PM
ummm... i want to use that code but i don't know how to get it woking... what exactly in the code should i change??

jackie
01-22-2003, 04:54 PM
ive got a shorter code... for mp3s and stuff, i use a .WMA to make it load faster though... anyway, heres the code... <center><embed src="http://SOURCE" CONTROLS="PlayButton" width="50" height="22" autostart="true" loop="TRUE" autoreplay="TRUE"></center>
that should do it for you, just change the bold :D