Problem playing an embedded sound

O

OBAFGKM_RNS

I am not an expert in javascript, so forgive me if all this sounds
dumb.
On my webpage, I have slot machine. I want to hear a click sound when
the wheels stop spinning. Heres how i can SORT OF do it:

in my javascript:
var sound = document.getElementById("wl1_click");sound.Play();

and in my html:
<embed id="wl1_click" src="clickb.wav" width="0" height="0"
autostart="false" />

and here are the problems:
1. If i use hidden="true", the sound won't play in either Firefox
or IE. Without that line, it plays.
2. Even setting the width and height to "0", still shows an
annoying tiny image in Internet Explorer, and creates a big extra
space. Hidden="true" would solve that problem, but hidden="true"
prevents the sound from playing for me.
3. Also in IE, an annoying tag pops up saying "press SPACEBAR or
ENTER to activate and use this control."

I'm probably doing something wrong, so if anyone could help, it would
be much appreciated. Thanks.
 
O

OBAFGKM_RNS

I am not an expert in javascript, so forgive me if all this sounds
dumb.
On my webpage, I have slot machine. I want to hear a click sound when
the wheels stop spinning. Heres how i can SORT OF do it:

in my javascript:
var sound = document.getElementById("wl1_click");sound.Play();

and in my html:
<embedid="wl1_click" src="clickb.wav" width="0" height="0"
autostart="false" />

and here are the problems:
1. If i usehidden="true", the sound won't play in either Firefox
or IE. Without that line, it plays.
2. Even setting the width and height to "0", still shows an
annoying tiny image in Internet Explorer, and creates a big extra
space.Hidden="true" would solve that problem, buthidden="true"
prevents the sound from playing for me.
3. Also in IE, an annoying tag pops up saying "press SPACEBAR or
ENTER to activate and use this control."

I'm probably doing something wrong, so if anyone could help, it would
be much appreciated. Thanks.

I kind of rigged up a solution to these problems by doing this:
<div style="position: absolute; z-index:
-1;left:-10000;top:-10000;"><embed id="wl1_click" src="clickb.wav"
width="0" height="0" autostart="false" ></div>

Now the 1 pixel media player with the accompanying space and "press
SPACEBAR..." messagebox are out of view.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top