SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Feb 10, 2004, 09:23 #1
- Join Date
- Mar 2003
- Location
- London
- Posts
- 58
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Rollovers and play clips of sounds
Hi,
I have read all the threads on adding sound that I can find, not quite covering what I need to know tho!
I wish to add sound to several pages created in Dreamweaver, both sound on rollover of button, and MP3 audio clips that play in a new window with a description when clicked - i have followed the methods suggested in dreamweaver, but it doesn't do either. For 'rollover' the mouse goes over and then a new window pops up with Quicktime and plays the rollover sound through that.
Same thing happens on 'mouse down', but will not stay within the same page it always plays the sound in a new pop-up.
No flash please - this has to be done without!
Any ideas...
Thanks
-
Feb 11, 2004, 00:56 #2
- Join Date
- Jun 2002
- Location
- Vancouver, BC Canada
- Posts
- 372
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Well... as good as any board can be, they're not comparable to a search engine.
Here's the script/code you need for your project, and below that is a link to a DogPile search page where you can learn more about this stuff (take note of what keywords i used in the search box).
(replace the following sound file names)
Create a new html page and put the sound file description in it. Format that page anyway ya like. In the HEADER of the document, put this code:
- <bgsound src="oompaloompa.mp3">
In your main document, put this code into the HEADER section of the page:
- <script language="JavaScript" type="text/javascript">
<!--
function playSound(soundobj) {
var thissound= eval("document."+soundobj);
thissound.Play();
}
-->
</script>
<embed src="click.wav" autostart="false" hidden="true" name="mySound">
- <a href="newWindow.html" onMouseOver="playSound('mySound')" target="_new">Play My Sound!</a>
The coolest thing about this method is that by having the sound called through a mouseOver, instead of a click, you make sure the sound gets played before the clicked link can leave the current page. Just make sure you do 2 extra things for this:
1) Make your button sound effect very small in file size -- i.e. no more than 6kb if possible. Use 11khz and 16bit mono for your wav settings.
2) Use a preLoad script to load the sound file when the page loads, so that it'll be ready to go as soon as a button gets clicked.
Let me know if you have any trouble with this. Just read carefully though and it should be fairly easy to pull off.
Checkout this page for more learnin'.
http://www.dogpile.com/info.dogpl/se...2Bplay%2Bsound
-
Feb 12, 2004, 07:39 #3
- Join Date
- Mar 2003
- Location
- London
- Posts
- 58
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Cheers!
I wil ltry this over the weekend and let you know how it goes... Thanks again.
Bookmarks