PDA

View Full Version : sound on rollover


sin
01-16-2001, 01:39 AM
Thank you in advance for answering my ?

I am stuck; I can not get my sound to trigger, does the audio have to be saved as and AIFF or a WAV file, and how long should the clip be...

Hear is my code - what is wrong?

<HTML>
<HEAD>
<TITLE>RPage</TITLE>
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
<!-- Hide script from old browsers

function playSound(o) {
if (document.embeds['f1'] != null && document.embeds['f1'].IsReady()) {
document.embeds['f1'].play(false)
}
}

// End hiding script from old browsers -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=WHITE>
<CENTER><H1>My mp3</H1></CENTER>

<P><A HREF="javascript:void('')" onMouseover="playSound('f1')"><IMG SRC="but-1.gif" </A>
<H3>my mp3!</H3>
<EMBED SRC="f1.aiff" NAME="f1" HIDDEN=TRUE LOOP=FALSE AUTOSTART=FALSE MASTERSOUND>
</BODY>
</HTML>

kentholke
01-20-2001, 01:20 PM
Replace your function with this:

function playSound(){document.f1.play();}


Also, whether or not it affected you, you are missing a closing ">" on your image tag.