[FMX] Random Background tutorial

I’ve just completed the random background tutorial (thanks for making it so easy to follow!)

My questions are:

  1. Is there a way to alter the code so it’s not random, but instead follows a preset list of images? So, instead of pressing a button and randomly choosing from the 5 images, it would go through the list starting with image0

  2. Is there a way to preload the first image so it shows up when the viewer goes to the main page (where the background changes first occur)?

  3. If someone goes to a new scene within the larger movie, would I have to place the same code and button on every page and the viewer would have to load the background image every time?

Thanks in advance!

no one has an answer yet?

choice = Math.round(Math.random()*5);
switch (choice) {
case 0 :
	location.loadMovie("image0.swf");
	break;
case 1 :
	location.loadMovie("image1.swf");
	break;
case 2 :
	location.loadMovie("image2.swf");
	break;
case 3 :
	location.loadMovie("image3.swf");
	break;
case 4 :
	location.loadMovie("image4.swf");
	break;
case 5 :
	location.loadMovie("image5.swf");
	break;
}

I would do something like

choice = Number

See if that works. My AS level is medium but I don’t know anything about switch case stuff.