...

View Full Version : Button Sounds



Shoot2Kill
11-06-2006, 12:00 AM
OK, i am a total n00b when it comes to JavaScript, however, i think this is what i need...

i have fairly good knowledge with HTML, CSS, and PHP, but JS is my downfall.. :(

i have a web-site and when the user hovers the mouse over a button, i want it to make a sound, and also, i want it to make a different sound when it is clicked..

the sound will be a split second, like a beep, and will not be repeated...

i would greatly appreciate if someone could help me with this...

---also, the buttons are actually images/links...

thank you in advance,

Philip M
11-06-2006, 07:58 AM
You need something like:-

<embed src="firstSound.wav" hidden="true" autostart="false" name="soundfile1">
<embed src="secondSound.wav" hidden="true" autostart="false" name="soundfile2">

<p>="center"><a href="linkToAFile.html" ONMOUSEOVER="document.soundfile1.play(); ONCLICK="document.soundfile2.play();</a>

And please do not thank people in advance - it is rude and announces that you simply take offered help for granted.

Shoot2Kill
11-06-2006, 10:14 PM
You need something like:-

<embed src="firstSound.wav" hidden="true" autostart="false" name="soundfile1">
<embed src="secondSound.wav" hidden="true" autostart="false" name="soundfile2">

<p>="center"><a href="linkToAFile.html" ONMOUSEOVER="document.soundfile1.play(); ONCLICK="document.soundfile2.play();</a>

And please do not thank people in advance - it is rude and announces that you simply take offered help for granted.

ok, sorry for thanking you lol...

ohh, and do they have to be .wav will mp3 work, or any other formats..?

hmm, like i say, i n00b when it comes to JS... is this JS (do i need open and close JS tags) or is it all HTML..??? sorry if this sounds like a pathetic question...

Philip M
11-07-2006, 07:41 AM
Yes, other formats (MIDI, MP3 etc.) will work.

This is just HTML, there is actually no JavaScript involved.

Have a look at http://www.catb.org/~esr/faqs/smart-questions.html,
and you will see why it is better not to thank people in advance, and to avoid grovelling. To increase your chances of a helpful response just ask your question in an adult and straightforward manner.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum