JudyEF
01-30-2003, 11:20 PM
I am using a random music player script and would like to delay the music playing upon page loading. Is there a way to use setTimeout with this script? The script code follows:
var numasf = 4
var name=navigator.appName
day = new Date()
seed = day.getTime()
ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*numasf + 1,10)
if (ran == (1))
asf=("GeorgeWinston-GreatPumpkinWaltz-1.asf")
if (ran == (2))
asf=("GeorgeWinston-ACharlieBrownChristmas-2.asf")
if (ran == (3))
asf=("GeorgeWinston-EightFiveFive-1.asf")
if (ran == (4))
asf=("ChickCoreaTheGreatPumpkinWaltz-1.asf")
document.write('<BGSOUND SRC="http://www.geocities.com/wellhands/' + asf + '" WIDTH=0 HEIGHT=2 AUTOSTART=TRUE LOOP=1>')
if (name=="Netscape")
document.write('<EMBED SRC="http://www.geocities.com/wellhands/' + asf + '" WIDTH=0 HEIGHT=2 AUTOSTART=TRUE>')
document.write('background music is <TT>' + asf + '</TT>')
-----------------------------------------------------
And one more question: Is there a way to make this random script a little less random, so that it will definitely NOT play the same song that was just played upon page reload/refresh?
Any help is greatly appreciated....
var numasf = 4
var name=navigator.appName
day = new Date()
seed = day.getTime()
ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*numasf + 1,10)
if (ran == (1))
asf=("GeorgeWinston-GreatPumpkinWaltz-1.asf")
if (ran == (2))
asf=("GeorgeWinston-ACharlieBrownChristmas-2.asf")
if (ran == (3))
asf=("GeorgeWinston-EightFiveFive-1.asf")
if (ran == (4))
asf=("ChickCoreaTheGreatPumpkinWaltz-1.asf")
document.write('<BGSOUND SRC="http://www.geocities.com/wellhands/' + asf + '" WIDTH=0 HEIGHT=2 AUTOSTART=TRUE LOOP=1>')
if (name=="Netscape")
document.write('<EMBED SRC="http://www.geocities.com/wellhands/' + asf + '" WIDTH=0 HEIGHT=2 AUTOSTART=TRUE>')
document.write('background music is <TT>' + asf + '</TT>')
-----------------------------------------------------
And one more question: Is there a way to make this random script a little less random, so that it will definitely NOT play the same song that was just played upon page reload/refresh?
Any help is greatly appreciated....