The picture shows what I’m trying to do.
Here’s my code:
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 );
}
// when the image finishes loading
mclListener.onLoadInit = function(pic:MovieClip){
_level0.main.container2.createTextField("txtQuan", i+1, 0, 100, 80, 20);
var txtQuan:TextField = _level0.main.container2.txtQuan;
txtQuan.text = "How many : ";
}
// add the listener to the MovieClipLoader Object
mcl.addListener(mclListener);
I’ve got two questions:
First, if I add “trace (pic._name);” inside the onLoadInit function it outputs “pic3,pic2,pic1,pic0”. Why does it show up in reverse order of the for-loop?
Second, is the “pic:MovieClip” in “mclListener.onLoadInit = function(pic:MovieClip)” pointing to the “pic” in “mcl.loadClip( astrImages*, pic );”? If not, what is it pointing to? If it is, can I add another variable after “pic” so that I can pass it inside the onLoadInit function?
Ultimately what I would like to do is create a textfield under each pic.
I know this is a lot. It’s just too much for me to troubleshoot because I’m overwhelmed with all of these at once. If you can answer just one question I would greatly appreciate it. Thanks all.