View Full Version : Repeat random music player


thebrainoo
06-30-2006, 07:36 PM
k, fould a script to choose a random music from the list, but i want to repeat the randomness, not the music, so it will continue to play a new random one without refreshing. Here it is. <script>
var sound=new Array("music1.wma","music2.wma","music3.wma","music4.wma")
var randomsoundenumber=Math.floor((sound.length)*Math. random())
document.write("<EMBED SRC='"+sound[randomsoundenumber]+"' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='0' HEIGHT='0' ALIGN='CENTER'>")
document.write("<NOEMBED>")
document.write("<BGSOUND SRC='"+sound[randomsoundenumber]+"' LOOP='1'>")
document.write("<NOEMBED>")
document.write("</EMBED>")
</script>