Problem playing an embedded sound

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • OBAFGKM_RNS@yahoo.com

    Problem playing an embedded sound

    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.getEle mentById("wl1_c lick");sound.Pl ay();

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

    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.
  • OBAFGKM_RNS@yahoo.com

    #2
    Re: Problem playing an embedded sound

    On Jul 2, 12:09 am, OBAFGKM_...@yah oo.com wrote:
    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.getEle mentById("wl1_c lick");sound.Pl ay();
    >
    and in my html:
    <embedid="wl1_c lick" src="clickb.wav " width="0" height="0"
    autostart="fals e" />
    >
    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="t rue" 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="fals e" ></div>

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

    Comment

    Working...