So I've done my best to follow the instructions here, under #3:
http://www.phon.ucl.ac.uk/home/mark/audio/play.htm
But still no sound on mouseover. I'm using iweb, I'm new to web design, so I've got a few questions...
1. Is the author of the above link referring to something specific with "Evalsound," or is that just the name of the particular function?
2. Do I embed the first bit of code on the website body, and the 2nd bit over the picture I want to trigger the sound?
3. For multiple picture/sound combinations on a page (pic 1 triggers sound 1, pic 2 triggers sound 2, etc), do I have to re-embed both the 1st and 2nd bit of code for each picture/sound combination? Or can I just list all the audio files in the first embed and title them "sound1", "sound2", etc.
Thanks.
I hate html.
mouseover audio function for web site build
-
- steve albini likes it
- Posts: 366
- Joined: Wed Mar 07, 2007 9:25 pm
mouseover audio function for web site build
Alex C. McKenzie
Kind of a can of worms but...
you'll need to change onClick to onMouseOver
You can add as many of those as you want.
Those are just referencing these:
You can add as many as you have sounds. You change the id attribute of each one along with the src attribute. so the second one would look like this:
or
and you would reference it like this:
the bit is a reference to the ID of the <embed> stuff up top.
That's untested but that's the idea. Problem may be that if some one mouses over something twice, the sounds will overlap.
Also, that code example is ancient in nerd years. "tested in IE6 and Firefox 1.0". There are a lot of newer libraries I'd be inclined to hitch my wagon to. http://www.schillmania.com/projects/soundmanager2/ looks pretty good. You can also try something with soundcloud https://github.com/soundcloud/Widget-JS-API/wiki[/code]
Code: Select all
<input type="button" value="Play Sound" onClick="EvalSound('sound1')">
You can add as many of those as you want.
Those are just referencing these:
Code: Select all
<embed src="success.wav" autostart=false width=0 height=0 id="sound1"
enablejavascript="true">
Code: Select all
<embed src="sound2.wav" autostart=false width=0 height=0 id="sound2"
enablejavascript="true">
Code: Select all
<embed src="myGreatSong.wav" autostart=false width=0 height=0 id="myGreatSong"
enablejavascript="true">
Code: Select all
<input type="button" value="Play Sound" onMouseOver="EvalSound('myGreatSong')">
Code: Select all
EvalSound('myGreatSong')
That's untested but that's the idea. Problem may be that if some one mouses over something twice, the sounds will overlap.
Also, that code example is ancient in nerd years. "tested in IE6 and Firefox 1.0". There are a lot of newer libraries I'd be inclined to hitch my wagon to. http://www.schillmania.com/projects/soundmanager2/ looks pretty good. You can also try something with soundcloud https://github.com/soundcloud/Widget-JS-API/wiki[/code]
-
- steve albini likes it
- Posts: 366
- Joined: Wed Mar 07, 2007 9:25 pm
-
- steve albini likes it
- Posts: 366
- Joined: Wed Mar 07, 2007 9:25 pm
Who is online
Users browsing this forum: No registered users and 183 guests