I am trying to upgrade my image gallery.
I have an image gallery of 25 images created and named image101, image 102, ect…
The images are loaded dynamically from a list of 100 images. I can easily pick the images randomly and load them into a gallery.
I have two problems…
-
I can either get the gallery to format correctly or when selected select the correct images. I can’t seen to get both to work refer to swf’s.
-
once a number is selected I do not want the same number selected again so I don’t the sames images more then once. This is of little concern because eventually I will have such a large pool of images to choose from but I am curious how it is done.
function gallery () {
for (var i = 101; i < numberOfImages; i++) {
//**********************************
var randomNum:Number = Math.floor (Math.random () * (numberOfImages - startingNumber)) + startingNumber;
//**********************************
this.attachMovie ("image", "image" + i, i);
this.myMCL.loadClip ("image" + randomNum + ".jpg", this["image" + i].painting);
this["image" + i]._alpha = 100;
this["image" + i]._x = 40;
this["image" + i]._y = 50;
if (this["image" + (i - 1)]._x > 175) {
this["image" + i]._y = this["image" + (i - 1)]._y + 100;
this["image" + i]._x = 40;
} else {
this["image" + i]._x = this["image" + (i - 1)]._x + 100;
this["image" + i]._y = this["image" + (i - 1)]._y;
}
}
}