Hello,
Im working on my site and I have a random background script setup. Heres the code that Im using now.
choice = Math.round(Math.random()*4);
switch (choice) {
case 0 :
_root.background.loadMovie("background1.swf");
break;
case 1 :
_root.background.loadMovie("background2.swf");
break;
case 2 :
_root.background.loadMovie("background5.swf");
break;
case 3 :
_root.background.loadMovie("background7.swf");
break;
case 4 :
_root.background.loadMovie("background8.swf");
break;
}
Now I love the way thats its working and but one thing that is kinda crappy is that sometimes it suffers from repeating the same background a couple of times before going to another random background. Now I know that its because the script is working properly but can anyone think of a method that I could use to make it not be able to pull up the last background that it has already loaded? I dont want to make it static because not only do I have this setup for when you enter the site but also its random when you click on one of the nav buttons because I want to try to keep my site dynamic.
Any ideas?
Thanks in advance.