...

View Full Version : Rollover Images, Additional Image and Sound



jgbarber65
12-15-2005, 03:25 AM
I have rollover images that also change and additional image:

if (document.images) {
image1on = new Image();
image1on.src = "myimage1on.gif";

image1off = new Image();
image1off.src = "myimage1off.gif";

otherImageDefault = new Image();
otherImageDefault.src = "default.gif";

otherImage1 = new Image();
otherImage1.src = "myimagebanner1.gif";

}

<td width=393 bgcolor="#0000A8"><a href="mylink.html" onMouseOver="changeImages('image1', 'image1on', 'otherImage', 'otherImage1')" onMouseOut="changeImages('image1', 'image1off', 'otherImage', 'otherImageDefault')"><img name="image1" src="myimage1on.gif" alt="myAltTag" width=81 height=16 border=0></a>

I would like to add sound to this onMouseOver with the following:

<embed name="wav01" src="audio.wav" autostart="false" mastersound hidden="true" loop="true" volume=100 width=0 height=0>

and

;javascript:jsPlay('wav01');return true;

and

;javascript:jsStop('wav01');return true;

I tried this below, but it gives me an error. What is the correct way to do this?

<td width=393 bgcolor="#0000A8"><a href="mylink.html" onMouseOver="changeImages('image1', 'image1on', 'otherImage', 'otherImage1');javascript:jsPlay('wav01');return true;" onMouseOut="changeImages('image1', 'image1off', 'otherImage', 'otherImageDefault');javascript:jsStop('wav01');return true;"><img name="image1" src="myimage1on.gif" alt="myAltTag" width=81 height=16 border=0></a>

Thank you

:)

_Aerospace_Eng_
12-15-2005, 03:39 AM
If the jsplay and jsstop functions work, you should be able to do this

<a href="mylink.html" onMouseOver="changeImages('image1', 'image1on', 'otherImage', 'otherImage1');jsPlay('wav01');" onMouseOut="changeImages('image1', 'image1off', 'otherImage', 'otherImageDefault');jsStop('wav01');"><img name="image1" src="myimage1on.gif" alt="myAltTag" width=81 height=16 border=0></a>
Lose the javascript: stuff its doing nothing and not needed.

jgbarber65
12-15-2005, 03:55 AM
I tried it and it's returning a Runtime Error still. I have used these jsPlay & jsStop commands with other rollovers, but not with rollovers with an additional image.

I don't know if the jsPlay and jsStop are in the right position within the MouseOver line.

Thanks,
Joe

_Aerospace_Eng_
12-15-2005, 04:12 AM
They are fine, I think it has something to do with your jsplay and jsstop functions, post the scripts for those.

lansing
12-17-2005, 09:57 AM
If the jsplay and jsstop functions work, you should be able to do this

<a href="mylink.html" onMouseOver="changeImages('image1', 'image1on', 'otherImage', 'otherImage1');jsPlay('wav01');" onMouseOut="changeImages('image1', 'image1off', 'otherImage', 'otherImageDefault');jsStop('wav01');"><img name="image1" src="myimage1on.gif" alt="myAltTag" width=81 height=16 border=0></a>
Lose the javascript: stuff its doing nothing and not needed.

Does the code:
jsPlay('wav01');" need to be something like this below or what ever the file format is? Don't it need the 3 digit file format on it?
jsPlay('wav01.mdi');"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum