|
-
java script help
hi everyone,
I need a preload script to preload sounds so that each time someone clicks on a picture, this sound will take the characteristic of the bgsound. I have the actual sound code written with the onCLick function, but i need these sounds to preload so there will be no time delay. thanks.
------------------
"There are two steps to success: 1. Never tell everything you know 2. See #1"
-
Ursus Arctos Moderatis
This is a generic image preloader, but it should work for sounds just the same. Simply change what's between the quotes below to whatever sounds you want preloaded.
<script language=javascript>
<!--- //
imgNames = new Array(
"/sounds/yoursound.wav",
"/sounds/yoursound2.wav"
)
loadImgs = new Array()
for(i=0; i < imgNames.length; i++) {
loadImgs[i] = new Image;
loadImgs[i].src = imgNames[i];
}
// --->
</script>
-
thank you!
------------------
"There are two steps to success: 1. Never tell everything you know 2. See #1"
-
Ursus Arctos Moderatis
My pleasure! Lemme know if it works or not!
-
thank you, the preload script worked well in ie. however, i still can't get my sounds to play in netscape using an onClick="bgsound.src=''...i am not even sure if netscape supports bgsound??? thoughts? thanks.
------------------
"There are two steps to success: 1. Never tell everything you know 2. See #1"
-
Ursus Arctos Moderatis
Yeeeaaaah....Netscape's always been a little tricky with playing sounds. I'm sorry but it really is a bad browser. I really wouldn't know how to help you in that aspect...I've personally never found a way to get Netscape to play sounds on mouseEvents properly, outside of doing the whole thing in Flash of course. Best of luck to you buddy
-
aside from my planned international boycott on netscape (because it does not support vbscript, css, some javascript and html), and have a few ideas using the embed src tag and arrays to make an onClick play bgsound thing work. I will post it when I figure it out. Thanks for your help with the preload.
------------------
"There are two steps to success: 1. Never tell everything you know 2. See #1"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|