Click to See Complete Forum and Search --> : Javascripting with sounds


happystan257
10-20-2003, 04:08 PM
Hello.
Don't be mistaken with the subject Javascripting with sounds, its more complicated than that. I want to put sound on my website BUT there are a couple complications...
This is my website: http://webpages.charter.net/cs-corner/index.html
And as you can see its still in its "beta" forms :D and also it has a nice theme changer that I integrated into it. Now here is what I want to do. I want to make it so when I change to a theme it plays certain background noises at certain times. For example: when you switch to the Train theme I want it to play the noise of these dogs barking at an interval of lets say every 30 seconds or so. With the Aztec theme I want a constant sound of rain once you switch to it. I also want the ability so that the person visiting the website can turn the sound on or off. Can someone help me out? I'm fairly new to javascript.

Jona
10-20-2003, 11:13 PM
Your site looks quite nice, in my opinion, and makes good use of CSS. (Although there are a few things that I would recommend you do differently, at least you are not using tables for layout.)

For Internet Explorer, you can have a hidden BGSOUND element (invalid HTML, but I'd use document.write() to put it on the page), and update its SRC depending on which stylesheet is selected. I don't know if BGSOUND works in Mozilla, Netscape or Opera, but it does work in Internet Explorer. A script I made. (http://geocities.com/god_loves_07/next_mid.html)

[J]ona