Flash & Swish  Home Flash & Swish Swish Tutorials Random Swish Movies
rss

Random Swish Movies

Author: mc More by this author


Random Swish MoviesHi all:

Whenever a usuary visit ours site , it always sees same intro .

With this script you can see one intro different everytime.

<SCRIPT language=JavaScript>

var r1=1
var r2=5

function Randomise(r1, r2) {
if (r2 > r1) return (Math.round(Math.random()*(r2-r1))+r1);
else return (Math.round(Math.random()*(r1-r2))+r2);
}
function MakeArray(size) {
this.length = size;
for(var g = 1; g <=size; g++);
{
this[g] = 0;
}
return this;
}



function getSwish() {
swishArray = new MakeArray(2);
swishArray[1] = "intro1.swf";
swishArray[2] = "intro2.swf";
swishArray[3] = "intro3.swf";
swishArray[4] = "intr04.swf";
swishArray[5] = "intro5.swf";
randSwish = swishArray[Randomise(r1,r2)];
return randSwish;
}

function drawme() {
document.writeln("<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ");
document.writeln(" codebase='http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0' ");
document.writeln(" ID=Untitled WIDTH=100% HEIGHT=100%> ");
document.writeln(" <PARAM NAME=movie VALUE="+getSwish()+"> ");
document.writeln(" <PARAM NAME=menu VALUE=false> ");
document.writeln(" <PARAM NAME=quality VALUE=high> ");
document.writeln(" <PARAM NAME=bgcolor VALUE=#000000> ");
document.writeln(' <PARAM NAME="loop" value="true"> ');
document.writeln(' <PARAM NAME="SCALE" VALUE="showall"> ');

document.writeln( "</OBJECT></center>");
}


</SCRIPT>

Last script is for 5 different intros.

Only thing do you need is change r2 variable (number of intros) and add or clear "swishArray[X] = "introX.swf";" on function getSwish()

Cheers



Author's URL: www.swish-db.com

Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Random Swish Movies"