Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-29-2007, 03:10 AM   PM User | #1
elusified
New to the CF scene

 
Join Date: Aug 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
elusified is an unknown quantity at this point
Play the next track when the current one finishes

Hey guys, i'm currently doing a website that required random background music. But now im facing a problem where how can i modify my current script so that it will auto play the next track instead of looping the current track? Im kinda new to this. thanks in advance =)

Code:
var sound1="sounds/2001spce.mid"
var sound2="sounds/20fox.mid"
var sound3="sounds/9010v2.mid"
var sound4="sounds/adam.mid"
var sound5="sounds/apollo13.mid"
var sound6="sounds/airwolf.mid"
var sound7="sounds/btfuture.mid"
var sound8="sounds/baywatch.mid"
var sound9="sounds/chicagobull.mid"
var sound10="sounds/xfile.mid"
var x=Math.round(Math.random()*9)
if (x==0) x=sound1
else if (x==1) x=sound2
else if (x==2) x=sound3
else if (x==3) x=sound4
else if (x==4) x=sound5
else if (x==5) x=sound6
else if (x==6) x=sound7
else if (x==7) x=sound8
else if (x==8) x=sound9
else x=sound10
 
if (navigator.appName=="Microsoft Internet Explorer")
document.write('<bgsound src='+'"'+x+'"'+' loop="infinite">')
else 
document.write('<embed src='+'"'+x+'"'+'hidden="true" border="0" width="20" height="20" autostart="true" loop="true">')
elusified is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT +1. The time now is 03:20 AM.


Advertisement
Log in to turn off these ads.