[Javascript] RES: Buttons and Sound in FireFox

SosCpdGMail soscpd at gmail.com
Tue Sep 11 15:17:11 CDT 2007


I use this

var sound2Embed = null;

function sound2Play() 
  {
    if ( !sound2Embed ) 
      {
        sound2Embed = document.createElement("embed");
        sound2Embed.setAttribute("src", "init.wav");
        sound2Embed.setAttribute("hidden", true);
        sound2Embed.setAttribute("autostart", true);
      } 
    else sound2Stop();
    sound2Embed.removed = false;
    document.body.appendChild(sound2Embed);
  }

function sound2Stop() 
  {
    if ( sound2Embed && !sound2Embed.removed ) 
      {
        document.body.removeChild(sound2Embed);
        sound2Embed.removed = true;
      }
  }

Work fine in Opera, IE and, with a little apple plugin, in firefox.

-----Mensagem original-----
De: javascript-bounces at lists.evolt.org
[mailto:javascript-bounces at lists.evolt.org] Em nome de tedd
Enviada em: terça-feira, 11 de setembro de 2007 12:42
Para: JavaScript List
Assunto: Re: [Javascript] Buttons and Sound in FireFox

>  > I can get sound to work with javascripot in IE but not firefox
>>  
>Probably the best way to provide cross-browser sound is with a small
>flash player.
>

I got it to work with all browsers that I tested without using a 
flash player, like so:

http://sperling.com/examples/captcha/

But, it's been a while since I worked with this code.

Cheers,

tedd
-- 
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com
_______________________________________________
Javascript mailing list
Javascript at lists.evolt.org
http://lists.evolt.org/mailman/listinfo/javascript




More information about the Javascript mailing list