Hi there,
I’m creating a series of banners for a website. There are 3 so far with more to be made. I have made each banner as a separate swf file.
The thing I would like it to do it create a randomly ordered array of the banner swf names and then load the banners in that order. Once the banners have been played or loaded through, I would l simply like it repeat that same order again.
I have managed to create an array and play through that array in an ordered loop, but how do I create a random array that will do the same thing?
I’m not sure if I’m explaining things clear enough. If you need more clarification, please let me know.
Here’s the code I have in the container swf. The last frame of each of the banners calls the loadNewBanner() function.
clipNumber = 0;
var Banner = new Array ();
Banner[0] = “banner1.swf”;
Banner[1] = “banner2.swf”;
Banner[2] = “banner3.swf”;
b = -1;
//
function loadNewBanner() {
clipNumber++;
if (b >= 3) {
b = 0;
} else {
b++;
}
bannerName = Banner**;
mc_instance = “image_mc”+clipNumber;
this.createEmptyMovieClip(mc_instance, this.getNextHighestDepth);
loadMovie(bannerName, mc_instance);
trace("loaded “+bannerName+” into "+mc_instance);
}
loadNewBanner();