Hi I’m using Flash 8 and AS 2.
I’m trying to make a watermark grid for an image viewer I’m working on. So far I’ve managed to load an external image (in this case a .png file) into multiple containers and put it into a 5 wide by 4 tall grid based on the image and stage size.
My code works, but it is a bit bulky and tedious, and will get worse if I ever want to use a smaller image with a larger grid.
Is there a way for me to simplify my code (so I don’t have to copy tons of code for each line of images) so I can load the external .png, and then just modify numbers of rows and columns for the grid, as well as the image size in pixels of the images?
I’d also like the grid to start with the .png image centered on the stage and duplicating out from there.
I’ve attached the Flash file and the .png file for you to look at.
Here is the code I’m currently using (yes i know it’s bulky, that’s why I’m asking for a simpler suggestion
/////First Row 1-5/////
createEmptyMovieClip(“container1”,1);
container1._x=0
container1._y=0
container1.loadMovie(“watermark_2.png”);
createEmptyMovieClip(“container2”,2);
container2._x=110
container2._y=0
container2.loadMovie(“watermark_2.png”);
createEmptyMovieClip(“container3”,3);
container3._x=220
container3._y=0
container3.loadMovie(“watermark_2.png”);
createEmptyMovieClip(“container4”,4);
container4._x=330
container4._y=0
container4.loadMovie(“watermark_2.png”);
createEmptyMovieClip(“container5”,5);
container5._x=440
container5._y=0
container5.loadMovie(“watermark_2.png”);
/////This code repeats for 2nd, 3rd and 4th Rows ---- there are 20 images in this grid/////
Thanks!
Hondo311