mikevaleriani
11-05-2002, 07:29 PM
Hello,
I am using this script in my site, but in order to hear a new music the visitor must reload the page. Does anyone know hot to make it play music randomly (like it's doing) and play a different midi when the first one is over?
Here is the script:
<SCRIPT LANGUAGE="JavaScript">
<!--
soundnum = 8;
music = new Array();
music[0]="ififall.mid";
music[1]="imagine.mid";
music[2]="tiltherewasyou.mid";
music[3]="carlo.mid";
music[4]="newyork.mid";
music[5]="iwill.mid";
music[6]="white.mid";
music[7]="careless.mid";
music[8]="yesterday.mid";
soundRnd = Math.floor(Math.random()*soundnum);
Em1='<EMBED src="./midi/';
Em2='" LOOP="true" REPEAT="true" AUTOSTART="true"';
Em3=' WIDTH="0" HEIGHT="0" HIDDEN = "true" >'
document.write(Em1+ music[soundRnd] +Em2+Em3);
//-->
</SCRIPT>
Thank you so much for your time,
Mike
www.mikevaleriani.com
I am using this script in my site, but in order to hear a new music the visitor must reload the page. Does anyone know hot to make it play music randomly (like it's doing) and play a different midi when the first one is over?
Here is the script:
<SCRIPT LANGUAGE="JavaScript">
<!--
soundnum = 8;
music = new Array();
music[0]="ififall.mid";
music[1]="imagine.mid";
music[2]="tiltherewasyou.mid";
music[3]="carlo.mid";
music[4]="newyork.mid";
music[5]="iwill.mid";
music[6]="white.mid";
music[7]="careless.mid";
music[8]="yesterday.mid";
soundRnd = Math.floor(Math.random()*soundnum);
Em1='<EMBED src="./midi/';
Em2='" LOOP="true" REPEAT="true" AUTOSTART="true"';
Em3=' WIDTH="0" HEIGHT="0" HIDDEN = "true" >'
document.write(Em1+ music[soundRnd] +Em2+Em3);
//-->
</SCRIPT>
Thank you so much for your time,
Mike
www.mikevaleriani.com