Tyler Is Random
11-12-2003, 10:37 PM
I'm attempting to make a random WMA file stream on my personal blog (http://www.tylersticka.com/blog) with accompanying artist and song title beneath it. Unfortunately, upon loading it always seems to pick the number "1," as it always loads the second option here. Any help you could give would be very much appreciated, the code is below. Thank you!
var randomnumber=Math.round(Math.random()*5);
if (randomnumber=0) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/blur_mellowjam.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Blur - Mellow Jam</center>');
};
else if (randomnumber=1) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/everclear_distorto.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Everclear - El Distorto De Melodica</center>');
};
else if (randomnumber=2) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/coxon_lake.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Graham Coxon - Lake</center>');
};
else if (randomnumber=3) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/gorillaz_lhsm.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Gorillaz - Left Hand Suzuki Method</center>');
};
else if (randomnumber=4) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/blur_frenchsong.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Blur - French Song</center>');
};
var randomnumber=Math.round(Math.random()*5);
if (randomnumber=0) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/blur_mellowjam.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Blur - Mellow Jam</center>');
};
else if (randomnumber=1) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/everclear_distorto.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Everclear - El Distorto De Melodica</center>');
};
else if (randomnumber=2) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/coxon_lake.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Graham Coxon - Lake</center>');
};
else if (randomnumber=3) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/gorillaz_lhsm.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Gorillaz - Left Hand Suzuki Method</center>');
};
else if (randomnumber=4) {
document.write('<object id="MediaPlayer" width=240 Height=45'
+ 'classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95F"'
+ 'standby="Loading Media Player"'
+ 'Type="application/x-oleobject">'
+ ''
+ ' <param name="Filename" value="file.wax">'
+ ' <embed type="application/x-mplayer2"'
+ ' src="http://www.tylersticka.com/blog/music/blur_frenchsong.wax"'
+ ' name="MediaPlayer"'
+ ' width=200'
+ ' height=45>'
+ ' </embed>'
+ '</object><br />'
+ '<center>Blur - French Song</center>');
};