Gernot Back: sound buttons, but not flash :)

Beitrag lesen

Hallo andi,

Hallo hab ein problem mit meinem script, es sagt mir immer
document.all.sound.scr = null oder klein objekt

Was ist "es", welcher Browser meldest dies?

hier das script, buttons sollen beim drafclciken ect einen ton abspielen:

<script language="javascript">
function abspielen()
{
if (document.all)
document.all.sound.scr = "http://www.midistern.de/gewehr1.wav";
}

</script>

<a onclick="abspielen()" href="...">test</a>

Wo und wie hast du in deinem HTML-Code denn den Sound eingebunden? Hat das entsprechende Element denn überhaaupt eine ID mit dem Wert "sound"? Warum probierst du es statt mit "document.all.sound" nicht mit "document.getElementById('sound')", das verstehen auch mehr Browser.

Gruß Gernot