Random swish Movies - SWiSH 2 Tutorials
 
  Buy Ebooks, Video Games, DVDs, Electronics and more !
Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads Make Money Online Blog . Free Image and Photo Sharing and Hosting

 

 

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

   Free image hosting
   Web Design Pakistan
   Swish Templates
   SWiSH Climax
   Talkfreelance Community
   Template Desire
   Lite boards
   Script Sector
   GimpTalk
   13dots
   Idea Designs
   PHP Cafe
   Sposatoettore
   Free swishmax templates
   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


© 2002-2005 Flaxweb Network | Article Manager | Gimp Tutorials Library | RAD C++ Library | Free C/C++ Sourcecode |
Sites of interest : Web Design Blog | Swish Templates | Swishmax Ebook | Photoshop Templates | Gimp Tutorials | Text Forum | Make Money Online