yet anohter sound mouse over question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to create a mouse over with a static gif, an animated gif
and a wav or mp3
per my clients request

I can get te image mouseover, but not the sound.

Any suggestions are appreciated. At the moment i simply have the mouse
over image up without the sound

PS oh and it would be nice to be cross browser compliant (those are his

Re: yet anohter sound mouse over question

Hi Kryss,

Here is the script...

<!-- --><bgsound id="soundfiles">
<script language="JavaScript"><!--
var aySound = new Array();

aySound[0] = "../audio/select.wav";
aySound[1] = "../audio/click.wav";

IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {;
auCon = IE? document.all.soundfiles:auEmb;
auCon.control = auCtrl;
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
function playSound(whSound) { if (window.auCon)
auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon)
auCon.control(whSound,false); }

...and here is the call...

<a href="newpage.html" onMouseOver="playSound(0)"

Hope that helps


Quoted text here. Click to load it

Re: yet anohter sound mouse over question

Andrew Bailey wrote:
Quoted text here. Click to load it

<snipped ancient script>

Haven't seen the LiveAudio plug in since Netscape 4.x and it not
supported by later versions and the Gecko browsers. I have tried to hack
  to transfer the old but in to the new browser but it does not work.

2nd Does not work in IE, maybe the new "upgrade" patches that settled
that plug-in patent issue with embedded plug-in is a play here.

In NN4.6 get error

JavaScript Error: , line 51:
this.document.embeds[whSound] has no properties.

I believe if you wish to have multimedia buttons that that flash is
probably your best overall bet maximum support.

Take care,

Re: yet anohter sound mouse over question

Kryss wrote:
Quoted text here. Click to load it

You can get an image or text onMouseOver for sound for the WMP on
browsers that support ActiveX for the WMP, This means IE browsers and
close relatives with the WMP installed, but not the Mozilla
family(recent Mozilla, Firefox, Netscape) unless they have added a
special third party ActiveX plugin for their browser. Here is an
example at . It has both
a onMouseOver and link to another page for text, an image, and a tiny
hotspot(period) just under the animated frog. In this case the sound is
selected at random from an array of 11 different wav and midi files.
You likely also could use mp3 and possibly wma. The important thing is
that this method does no harm if you are on a browser that does not
support it - you just do not hear the sound. I dug this up from some
old backups of mine, and the code is old. However it at least validates
as W3C html 4.01 transitional and CSS. You will most likely need to
change the code for a fixed sound URL for each hot image rather than
using the random one on my page. Sorry, but this is the best I have at
hand at the moment. If there is a method that is general for all common
browsers and all common sound players, I have not seen it. But then I
have not researched this subject in a long time.

Re: yet anohter sound mouse over question

thank you everyone for your suggestions, this page will have flash
involved as well so perhaps that is the best way to do it but for the
sample sans flash, these will work wonders

this is an awesome place
Thanks again

Site Timeline