K
Knocked Wood
Hi,
I looked around and can't find anything on this at all and can not get
it to work for IE.
I'm trying to loop multiple sounds on a game, with three unique
variables, when a link is clicked. Something like...
<Script Language="JavaScript">
<!--
function playSound(soundName, loops, timeLength){
document.embeds[soundName].play();
if(loops > 1){
setTimeout("playSound(soundName, loops, timeLength)", timeLength); }
} // End function.
//-->
</Script>
<!-- EMBEDED SOUNDS//-->
<embed src="frog.wav" autostart="false" loop="false" hidden="true"
name="frog">
<embed src="bird.wav" autostart="false" loop="false" hidden="true"
name="bird">
<embed src="rooster.wav" autostart="false" loop="false" hidden="true"
name="rooster">
<!-- LINKS //-->
<a href="javascript
laySound('frog', 3, 4500);">FROG</a>
<a href="javascript
laySound('bird', 1, 3000);">BIRD</a>
<a href="javascript
laySound('rooster', 2, 7500);">ROOSTER</a>
....errrrr, umm, ...or something like that ;-\
There could be a typo above because I'm just going by memory, (which
hasn't been very good lately). Plus I'm on no sleep for quite a while.
But I "think" it might resemble what I've been trying to do?
There's several sounds on the page.
Each has it's own link and variables,
...name (soundName),
...times it will play (loops),
...and sound length (soundLength).
I have been able to get "something like" above (not exactly like example
above) to work on MSN-TV but not for IE on a pc. I'm not a big fan of
sounds on a webpage but in this situation, a game, we're trying to get
it to work but so far unsuccessfully. So I do know my way around JS a
little bit and sounds almost not at all. This problem has been holding
up this page for a while and am truly using comp.lang.javascript here as
a last resort! Any help or guidance at all on this would be very much
appreciated, (more than you'd ever know!), thanks!
BTW;
I've lurked here on and off for years, learned a lot, and really prefer
to find out my own answers, to just work it out myself, but this one
really has me stumped
Have a good weekend,
Thanks again,
I looked around and can't find anything on this at all and can not get
it to work for IE.
I'm trying to loop multiple sounds on a game, with three unique
variables, when a link is clicked. Something like...
<Script Language="JavaScript">
<!--
function playSound(soundName, loops, timeLength){
document.embeds[soundName].play();
if(loops > 1){
setTimeout("playSound(soundName, loops, timeLength)", timeLength); }
} // End function.
//-->
</Script>
<!-- EMBEDED SOUNDS//-->
<embed src="frog.wav" autostart="false" loop="false" hidden="true"
name="frog">
<embed src="bird.wav" autostart="false" loop="false" hidden="true"
name="bird">
<embed src="rooster.wav" autostart="false" loop="false" hidden="true"
name="rooster">
<!-- LINKS //-->
<a href="javascript
<a href="javascript
<a href="javascript
....errrrr, umm, ...or something like that ;-\
There could be a typo above because I'm just going by memory, (which
hasn't been very good lately). Plus I'm on no sleep for quite a while.
But I "think" it might resemble what I've been trying to do?
There's several sounds on the page.
Each has it's own link and variables,
...name (soundName),
...times it will play (loops),
...and sound length (soundLength).
I have been able to get "something like" above (not exactly like example
above) to work on MSN-TV but not for IE on a pc. I'm not a big fan of
sounds on a webpage but in this situation, a game, we're trying to get
it to work but so far unsuccessfully. So I do know my way around JS a
little bit and sounds almost not at all. This problem has been holding
up this page for a while and am truly using comp.lang.javascript here as
a last resort! Any help or guidance at all on this would be very much
appreciated, (more than you'd ever know!), thanks!
BTW;
I've lurked here on and off for years, learned a lot, and really prefer
to find out my own answers, to just work it out myself, but this one
really has me stumped
Have a good weekend,
Thanks again,