HighDots Forums  

stop button for <bgsound src> wav. loop?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss stop button for <bgsound src> wav. loop? in the Macromedia Dreamweaver forum.

Reply
 
Thread Tools Display Modes
  #1  
Old   
Lyle Christine
 
Posts: n/a

Default stop button for <bgsound src> wav. loop? - 07-22-2005 , 06:25 AM






Is it possible to code a 'stop button' for a page that has a <bgsound source>
playing a looped wav. file.

I know I could get an interface using <embed> but they look really tacky.

Thanks for your help.




Reply With Quote
  #2  
Old   
Gary White
 
Posts: n/a

Default Re: stop button for <bgsound src> wav. loop? - 07-22-2005 , 10:10 AM






Lyle Christine wrote:

Quote:
Is it possible to code a 'stop button' for a page that has a <bgsound source
playing a looped wav. file.

Give your embed tag an ID:

<!--[if IE]>
<bgsound src="yoursound.wav" id="yoursound">
<a href="javascript:;"
onClick="document.getElementById('yoursound').stop ();">Stop</a>
<![endif]-->

I know of no way to restart it once you have stopped it and, of course,
the BGSOUND tag only works in IE. The only reliable, reasonably
x-browser way to use and control sound is using Flash, or using the
browser's plugin to play it.


Gary


Reply With Quote
  #3  
Old   
Lyle Christine
 
Posts: n/a

Default Re: stop button for <bgsound src> wav. loop? - 07-22-2005 , 10:57 AM



That's great, but for some reason when I hit stop music I get a javascripr error. Check out the page

www.tarotrealm.co.uk

Reply With Quote
  #4  
Old   
Gary White
 
Posts: n/a

Default Re: stop button for <bgsound src> wav. loop? - 07-22-2005 , 11:44 AM



Lyle Christine wrote:

Quote:
That's great, but for some reason when I hit stop music I get a
javascripr error. Check out the page

www.tarotrealm.co.uk

It worked for me in IE6. However, you have your <bgsound> tag between
the </head> and the <body> tag. That's no man's land. There should be
nothing between </head> and <body>. Try moving it into either before the
</head? tag or after the <body> tag, but before the </body> tag. You
should also wrap the "Stop Music" link in an IE conditional comment, so
that those browsers that don't support the bgsound tag, meaning
everything except IE, will not display the link. Clicking it in a
browser other than IE *will* generate an error.


Gary


Reply With Quote
  #5  
Old   
Lyle Christine
 
Posts: n/a

Default Re: stop button for <bgsound src> wav. loop? - 07-22-2005 , 01:23 PM



Ok, I've changed that but when I click the 'stop music' link, although the
music does stop, I still get the little warning at the bottom left of the
browser saying 'error on page' and the details are:

Line: 20
Char: 1
Error: Object doesn't support this property or method
Code: 0
URL: htt://www.tarotrealm.co.uk/title.htm

Also, does anyone know how to remove the line at the bottom that seperates the
two frames?
Thank you kindly for all your time and help.


Reply With Quote
  #6  
Old   
Gary White
 
Posts: n/a

Default Re: stop button for <bgsound src> wav. loop? - 07-22-2005 , 06:00 PM



Lyle Christine wrote:

Quote:
Ok, I've changed that but when I click the 'stop music' link, although the
music does stop, I still get the little warning at the bottom left of the
browser saying 'error on page' and the details are:

I didn't get that, but then again, I couldn't find any documentation
on a stop() method for the bgsound object either. Like I said, the
only reasonably reliable methods are to use the browser plug-in's
controller, or use Flash. Other than that, I don't have much more to
suggest.

Gary


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.