How do I get the for-loop’s i variable to be available inside the onLoadInit function???
for (var i = 0; i<nTotalPics; i++) {
main.createEmptyMovieClip("container"+i,i);
var container:MovieClip = main["container"+i];
container.createEmptyMovieClip("pic"+i,i);
var pic:MovieClip = container["pic"+i];
// load images
mcl.loadClip(astrImages*,pic);
// Thumbnail structure // USED to be pic. , now it's container.
container._x = (i%columns)*contWidth;
var newRow = Math.floor(i/columns);
container._y = newRow*contHeight;
}
// when the image finishes loading
mclListener.onLoadInit = function(pic:MovieClip) {
// I NEED TO USE THE FOR-LOOPS VARIABLE HERE. How??
}
// add the listener to the MovieClipLoader Object
mcl.addListener(mclListener);
This has been bugging me for about 2 months now.:sen: Maybe I’m looking at it the wrong way, but I need to create more things in the onLoadInit function using a for-loop.
Any ideas would be greatly appreciated