I am trying to pass an argument on Event.Complete, so once they load the image, i can handle them accordingly of the position, store them, etc. See below the code and the output:
var pic:Array = ["https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png","https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png","https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png","https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"];
for (var ii: uint = 0; ii < pic.length; ii++) {
var imageURLRequest:URLRequest = new URLRequest(pic[ii]);
var myImageLoader:Loader = new Loader();
myImageLoader.load(imageURLRequest);
trace ("the ii: " + ii);
myImageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(evt:Event)
{
doIt(evt, ii)
} , false, 0, true);
function doIt(evt:Event, msg:int) {
//var myBitmapData:BitmapData = new BitmapData(myImageLoader.width, myImageLoader.height);
//myBitmapData.draw(myImageLoader);
//var myBitmap:Bitmap = new Bitmap;
//myBitmap.bitmapData = myBitmapData;
trace ("message : " + msg);
}
}
/////Output
the ii: 0
the ii: 1
the ii: 2
the ii: 3
message : 4
message : 4
message : 4
message : 4
///Expected Output
/////Output
the ii: 0
the ii: 1
the ii: 2
the ii: 3
message : 0
message : 1
message : 2
message : 3
Thank for the help Speego