Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads | All Downloads

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Swish Templates
   SWiSH Climax
   GimpTalk
   Idea Designs
   Sposatoettore
   Try Acai Berry Diet
   Download Free Ringtones
   Swishzone

Manage your site with Flax Article Content Management System
Random swish Movies
Category : SWiSH 2 | Level : Beginner | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

Hi 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
Cheers


All rights reserved - swish-db.com