Gandalf said:
OK this is my element
<BGSOUND id="BGSOUND_ID" LOOP=1 SRC="IncomingIM.mp3">
<EMBED NAME="Bach" id="Bach" SRC="IncomingIM.mp3"
LOOP=FALSE AUTOSTART=FALSE HIDDEN=TRUE MASTERSOUND>
http://validator.w3.org/ will tell you that neither element is part of any
standard. Use the `object' element instead.
this is the function
function playSound() {
document.all['BGSOUND_ID'].src='IncomingIM.mp3';
document.all is another IE-ism that is only recently partially supported
by Gecko-based UAs in Quirks Mode (a bad move IMHO). Standards compliant
referencing won't help much here though, because the underlying markup is
not standards compliant.
document.getElementById('bach').play(false)
This might work if the element object reference could be retrieved (that is
assuming the proprietary `embed' element is reflected in the DOM) and the
used plugin had a play() method. But you don't tell which media player
plugin you use, let alone the UA where you have tested this to fail, or what
error messages you get. Read the FAQ Notes section I pointed you to, again.
That is not surprising, most of this is MSHTML-only. But which of the
numerous IE versions have you tested with? Which other UAs have you tested
with? Again, you are providing far too little information for an analysis.
PointedEars