How to write 'for' loop for this?

And in the meantime here’s something else . . .

I have an image that I have sliced into squares of equal size (200 x 200 pixels) using the slice tool in Fireworks. I would like to load each square (“tile”) into it’s own movie clip. The MCs are to be dynamically created on the fly. Basically I’ve got 3 rows and four columns. This is the code I have so far but I’m thinking there must be a way to write a for loop for this:

[AS]
// Create tile MCs
this.createEmptyMovieClip(“r1c1”, 1);
r1c1._x = 0;
r1c1._y = 0;
r1c1.loadMovie(“test_slices/r1_c1.jpg”);
this.createEmptyMovieClip(“r1c2”, 2);
r1c2._x = 200;
r1c2._y = 0
r1c2.loadMovie(“test_slices/r1_c2.jpg”);
this.createEmptyMovieClip(“r1c3”, 3);
r1c3._x = 400;
r1c3._y = 0
r1c3.loadMovie(“test_slices/r1_c3.jpg”);
this.createEmptyMovieClip(“r1c4”, 4);
r1c4._x = 600;
r1c4._y = 0
r1c4.loadMovie(“test_slices/r1_c4.jpg”);
this.createEmptyMovieClip(“r2c1”, 5);
r2c1.loadMovie(“test_slices/r2_c1.jpg”);
r2c1._x = 0;
r2c1._y = 200;
this.createEmptyMovieClip(“r2c2”, 6);
r2c2._x = 200;
r2c2._y = 200;
r2c2.loadMovie(“test_slices/r2_c2.jpg”);
this.createEmptyMovieClip(“r2c3”, 7);
r2c3._x = 400;
r2c3._y = 200
r2c3.loadMovie(“test_slices/r2_c3.jpg”);
this.createEmptyMovieClip(“r2c4”, 8);
r2c4._x = 600;
r2c4._y = 200
r2c4.loadMovie(“test_slices/r2_c4.jpg”);
this.createEmptyMovieClip(“r3c1”, 9);
r3c1.loadMovie(“test_slices/r3_c1.jpg”);
r3c1._x = 0;
r3c1._y = 400;
this.createEmptyMovieClip(“r3c2”, 10);
r3c2._x = 200;
r3c2._y = 400;
r3c2.loadMovie(“test_slices/r3_c2.jpg”);
this.createEmptyMovieClip(“r3c3”, 11);
r3c3._x = 400;
r3c3._y = 400
r3c3.loadMovie(“test_slices/r3_c3.jpg”);
this.createEmptyMovieClip(“r3c4”, 12);
r3c4._x = 600;
r3c4._y = 400
r3c4.loadMovie(“test_slices/r3_c4.jpg”);
[/AS]

I tried:
[AS]
x=1
for (i = 1; i<4; i++) {
for (j = 1; j<5; j++) {
this.createEmptyMovieClip(“r”+i+“c”+j, x)
x++;
}
}
[/AS]

but I have NO idead how to position the MCs or load them once they are created.

Any coding experts wanna take a stab at this one? :puzzled:

:bu: