width=150, height=80> *you may have to mess with the dimensions on that, it's been a while since I last figured that out.<br>
An alternative, if you still want it to play when you click on a link woud be to use the following JavaScript-enhanced link (replace !!! with the URL of the document being linked to and replace ??? with the URL of your wav file):<br>
<a href="#" onClick="document.writeln('<embed src=??? autostart=true>'); window.location='!!!';">Linked text/object here</a>
The following code code will play a .wav file when the mouse passes over the link.
<EMBED SRC="welcom98.wav" autostart="false" hidden="true">
<SCRIPT language="JavaScript">
<!--
function playHome()
{
if (document.all)
[tab]{
[tab]document.all.sound.src = "welcom98.wav";
[tab]}
}
//-->
</SCRIPT>
<bgsound id="sound">
<A HREF="#" onMouseover="playHome()">LINK TEXT GOES HERE</A>
HTH
Chris - did you place that <embed> in the <head>? I couldn't tell from your script, and was under the (perhaps mistaken) impression that it needed to be in the body...
Thanks Chris for the clarification. I use a similar script to the one you recommend, but have not used the <embed> tag, because when I tested it using NN on a Mac, it required the loading of a Quicktime plugin. I avoid using any scripts that force viewers to go out onto the web and download plugins, so did not use the <embed> tag (even though it worked perfectly in Windows). Admittedly that is probably too much caution, given the small percentage using NN on a Mac, but that's another thread.
I wish there was a way to use the <embed> tag (perhaps in conjunction with a js??) to get around that nasty "Plugin Required" alert. While I do not write js, and have tremendous respect for its flexibility, I continue to wonder why there is not a way to pre-load sound into its architecture. Seems like a major oversight, given the popularity of sound on websites....
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.