how to selectivly allow sound to play

  • Thread starter Thread starter MILES SANDIN
  • Start date Start date
M

MILES SANDIN

Folks:

I have a web site with sounds specified on the on the pages. I'd like
to place a control on the first page that would allow the user to allow or
suppress sounds. Any suggestions?

Miles Sandin
Sheltie Systems, Inc.
(e-mail address removed)
 
This may be way off target, but why not have a button on the first page
<input type="button" onclick="playit()">Click to play music

and then a named span where you want the music to play
<span id="music"></span>

And a JS function
function playit()
{
var musicdetail= '<embed src="minuet.mid" width="144" height="45"
autostart="true" loop="false"></embed>'

// above line can be any music source instead of "minuet.mid",
// preferably a .wav or something better.
// loop="false" can be set to loop="true" for continouous play

if (document.all)
document.all.music.innerHTML = musicdetail
else
if (document.getElementById)
document.getElementById("music").innerHTML = musicdetail
}

If there are multiple pages with multiple music sources, you would have to
name each separately, and refer to each including the page name. (Here I
would get a little lost.)

I could experiment a bit more with this myself, but hopefully so can you.
Others more experienced may have better advice.
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au

MILES said:
Folks:

I have a web site with sounds specified on the on the pages. I'd
like to place a control on the first page that would allow the user
to allow or suppress sounds. Any suggestions?

Miles Sandin
Sheltie Systems, Inc.
(e-mail address removed)


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
Back
Top