Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 Sound on image when mouse is over
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

joep
Novice

3 Posts

Posted - 24 Mar 2004 :  20:43:06  Show Profile  Visit joep's Homepage  Reply with Quote
Hi there,
is there any advise for what I want ?
When the mouse is over a image, I want to hear a sound.
Sound has to stop when mouse is out.
Thx !!
Joep.

Edited by - joep on 24 Mar 2004 20:49:00

s.dav
Site Admin

Italy
3364 Posts

Posted - 25 Mar 2004 :  08:55:12  Show Profile  Visit s.dav's Homepage  Reply with Quote
This feature will be supported in Dynamic HTML Editor Version 2.0.

You can do it using an HTML object and insert code by hands :-)

Regards, Davide

Edited by - on
Go to Top of Page

jrwebb01
Practical

41 Posts

Posted - 25 Mar 2004 :  15:38:46  Show Profile  Visit jrwebb01's Homepage  Reply with Quote
Hi Joep:

Try this script inserted into the <body> of your page:

<script LANGUAGE="JavaScript"><!--
var aySound = new Array();
// Below: source for sound files to be preloaded
aySound[0] = "sound1.wav";
aySound[1] = "sound2.wav";
// DO NOT edit below this line
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;
function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.auIEContainer: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); }
//--></script>
<a href="#" onMouseOver="playSound(0)" onMouseOut="stopSound(0)">sound 1</a>
<a href="#" onMouseOver="playSound(0)" onMouseOut="stopSound(0)">sound 2</a>

It is one of many useful scripts you will find at http://javascript.programmershelp.co.uk

Hope this helps. Good luck :)

Joe

Edited by - on
Go to Top of Page

n/a
deleted

492 Posts

Posted - 25 Mar 2004 :  17:31:34  Show Profile  Reply with Quote
Thanks Joe!

Your posts are always useful!!!!!!

Ciao Ciao De.

Edited by - on
Go to Top of Page

jrwebb01
Practical

41 Posts

Posted - 25 Mar 2004 :  21:18:47  Show Profile  Visit jrwebb01's Homepage  Reply with Quote
Hi De!

That is very kind. Thank you.

It is always a pleasure to help others explore and discover this remarkable web page editor. I wish I could do more.

Joe


Edited by - on
Go to Top of Page

Pelle
Super User

Italy
275 Posts

Posted - 26 Mar 2004 :  15:56:34  Show Profile  Visit Pelle's Homepage  Reply with Quote
Welcome joep!


Pelle.

Edited by - on
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000