PDA

View Full Version : Random Picture?


blake806
11-29-2001, 10:41 PM
I have several pictures and I'd like for a different one to load each time my animation runs, so the experience is different every time. What's the easiest way to make this happen?

Thanks...

Jesse
11-30-2001, 04:23 AM
Use the following code:
ran = random(10);
// assuming you have 10 images
_root["image"+ran]._visible = true;
// assuming you start with your 10 images, _visibile set to false
// each with an instance name of image1, image2, etc.