Go Back   Webmaster Forum > Forum Archives > Cyber-UG Forum Archive
REMOVE the ads below !
 
 
LinkBack Thread Tools
  # 1 (permalink)
Old
Newbie
Posts: 0
Join Date: Mar 2007
iTrader: (0)
random banner - 05-19-2007

Flash has never been so interactive. In this tutorial i will be showing you how to load up a random swf each visit. So lets start!

1- rename all your desired movies into banner(number).swf eg banner1.swf,banner1.swf they have to consiguative numbers starting at 1
2- Load up flash
3- go to windows>actions


Enter the following:
PHP Code:
PHP Code:
 itemtotal 2//total banners that are going to be viewed randomly
fscommand("flashpath");
temptotal itemtotal;
movieprefix "banner";//as for the file name set previosly
aItemTemp = new Array(); //set a new arrey
aMovie = new Array(); //set another new arrey
newvar math.round((math.random()*1)+1); // the alotherigom to work out the number which is going to be viewed.
loadMovieNum(movieprefix+(newvar)+".swf"1); //loads the movie 
test the movie by clicking controlenter again and again(that will refresh it
Tell me,how easy was that!
 


Thread Tools




vBulletin®, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd. | SEO by vBSEO | Skin developed by vBStyles.com