adding sound to mouse click????

having trouble qualifing for the right code to provide a user-defined sound event with a mouse click (when your visitor clicks over a specific object for the page). using wordpress, and in that embed code sections, I have:

< script LANGUAGE=" JavaScript" > <! —
// Preload and also play audio records with event handler (MouseOver sound)
// made by JavaScript Repository, (c)1999
// Receive more free javascripts from http: //jsarchive. 8m. com
var aySound = brand-new Array();
// Underneath: source for sound files for being preloaded
aySound0 = " http: //ultimatewomenchallenge. com/wp-content/uploads/2011/03/bugs_bye. wav";
// DON’T edit below this specific line
insurance coverage. write(‘< BGSOUND ID=" auIEContainer" > ‘)
IE = (navigator. appVersion. indexOf(" MSIE" )! =-1 & & insurance coverage. all) 1: 0;
NS = (navigator. appName==" Netscape" & & navigator. plugins" LiveAudio" ) A SINGLE: 0;
ver4 = IENS A SINGLE: 0;
onload=auPreload;
functionality auPreload()
when (! ver4) gain;
when (NS) auEmb = brand-new Layer(0, window);
altogether different
Str = " < DIV ID=’auEmb’ STYLE=’position: utter; ‘> < /DIV> ";
insurance coverage. body. insertAdjacentHTML(" BeforeEnd", Str);

var Str = ”;
for (i=0; i< aySound. duration; i++)
Str += " < EMBED SRC=’" +aySound+" WI AUTOSTART=’FALSE’ HIDDEN=’TRUE’> "
when (IE) auEmb. innerHTML = Str;
altogether different
auEmb. insurance coverage. open();
auEmb. insurance coverage. write(Str);
auEmb. insurance coverage. close();

auCon = IE insurance coverage. all. auIEContainer: auEmb;
auCon. deal with = auCtrl;

functionality auCtrl(whSound, play)
when (IE) this. src = enjoy aySoundwhSound: ”;
altogether different eval(" this. insurance coverage. embedswhSound. " + (play " play()": " stop()" ))

functionality playSound(whSound) if (window. auCon) auCon. control(whSound, true);
functionality stopSound(whSound) if (window. auCon) auCon. control(whSound, false);
//–>
< /script>
in the main " body" segment, I have:

< A NEW HREF=" javascriptlaySound(0); " > Click here to play sound< /A>

cant obtain it to work…. help

I’ve never noticed it done this way, and so I’m uncertain, but I think it’s advisable it to read
< A NEW HREF=" onClick=" playSound(0); " > Click here to play sound< /A> since you wish it to play when the mpouse is clicked.

This entry was posted in Web Design and tagged , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *