Issues with random background music

This is a discussion on "Issues with random background music" within the JavaScript Forum section. This forum, and the thread "Issues with random background music are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 28th, 2007, 10:10
New Member
Join Date: Aug 2007
Location: singapore
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Issues with random background music

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 =)

These are my codes:

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">')
Reply With Quote

Reply

Tags
background, music, random

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] About "background-image: fixed;" Scrolling Issues doctypedeclaration Web Page Design 9 Apr 13th, 2008 18:54
Random div background Narcassa JavaScript Forum 5 Apr 9th, 2008 18:54
Transparent Background Issues (especially in IE6) alfandango Web Page Design 1 Jan 12th, 2008 15:09
repeating background issues. Therealmatt Starting Out 4 Sep 20th, 2007 22:54
looping background music gwx03 Flash & Multimedia Forum 6 Sep 7th, 2003 03:07


All times are GMT. The time now is 05:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43