Music Script, On/Off, Cookies, Images

madmatt

Awesome is as awesome does.
Political Access
Joined
5 Apr 2002
Messages
13,314
Okay, I give up. I'm lost.

A client of mine wants music on her site. I told her she should provide the user with an on/off button that will remember their selection (stupid me -- I thought it would be easier).

I have the two images (GIF) and the song (MP3), but that's as far as I've gotten.

When the music is playing I need it to show the music on image. When it is off I need it to show the muted image. I need this script to work using cookies so the script will remember if the user wants to hear the music.

Hopefully you know what I mean. Thank you.
 
Take a look at the collapser I made for the front page last week: http://osnn.net/collapser.js

I think it's along the same lines as what you want, however I wouldn't know how to stop the music once it's playing (dependant on the embedding method, that is).

Hope that helps some.


Edit: There's also the simpler version of the script available here, http://speedyb.osnn.net/simple_hidy.html
 
Last edited:
I'll take a look, thank you.

I'm making some progress. If I could figure out how to make the stupid thing loop, work with cookies, and change the image. That script should help with the latter two.
 
Dave, I am using a different method (similar), but this method doesn't require the ActiveX control.

There is no "loop" property, only a "playCount" property. So, I set it to 1000. A value of 0 is supposed to make it loop but that isn't working.

I figured out the images too using JavaScript.

Last thing is the cookies.
 
Just use document.cookie(); in the same function/block you're changing the images :)
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back