Richard: Schaltflaeche und Sound?

Beitrag lesen

Hallo Georg,

ähnliche Probleme hatte ich auch, bis ich ein Artikel in der HomePage laß.

Dort habe ich unter der Adresse http://home.thezone.net/~rbennett/sitemap.htm

etwas gutes gefunden, nämlich das man den Sound auch Ab- bzw. Einschalten kann, doch leider funktioniert das mit dem Ein- Abschalten nicht.

Ich habe statt .midi -.wav genommen und alles wo mid oder midi steht in wav geändert. Der Suond lässt sich sehr gut abspielen sobald meine Seite geladen wird, man kann es auch so einastellen, das der Sound erst nach einigen sec. startet.
Ich füge mal das Script ein.

<html>
<head>
<title>Health Promotion</title>
<script>
<!--
sound="cheers.mid"
function soundOff(){
if (document.layers) {document.midi.document.write(" "); document.midi.document.close()}
if (document.all) midi.innerHTML=" "
}
function soundOn(){
if (document.layers) {
document.midi.document.write("<embed src="+sound+" autostart='true' loop='true' volume='60' hidden='true'>"); document.midi.document.close()}
if (document.all) midi.innerHTML="<embed src='"+sound+"' autostart='true' loop='true' hidden='true'>"
}
function getNewSound(){
sound=document.level.request.options[document.level.request.selectedIndex].value;
soundOff()
soundOn()
}-->
</script>
</head>
<body>
<div id="midi" style="position:absolute; visibility:show; left:30px; top:-10px; z-index:5">
<embed src="cheers.mid" autostart="true" loop="true" hidden="true"  volume='10'>
</div>
<div id="form1" style="position:absolute; visibility:show; left:30px; top:20px; z-index:5">
</div>
<form  action="" name="level">
<table bgcolor=eeeeee cellpadding=10><td>
<table bgcolor=c0c0c0><td>
<TABLE WIDTH="225" CELLSPACING="0" CELLPADDING="5" BORDER="0">
<TR><TD>
<CENTER>
<FONT SIZE="+2">Pick a Song</FONT><br><br>
<select name="request" size="1"  onChange="getNewSound()">
<option value="cheers.mid">pick a song (cheers)
<option value="panther.mid">Pink Panther
<option value="mash.mid">M*A*S*H
<option value="laworder.mid">Law & Order
<option value="mi-quiet.mid">Mission Impossible
</select></CENTER>
</td></tr><tr><td>
<CENTER><input type="button" value="Play" onClick="soundOn()">     
<input type="button" value="Stop" onClick="soundOff()"></CENTER>
</TD></TR></TABLE>
</td></table>
</td></table>
</form>
</body>
</html>

Richard