PDA

View Full Version : Loading multiple images problem


hulk
09-16-2007, 01:57 PM
i want to make a thumbnail scroller therefore i need multiple images loaded.
loading the pictures is not a problem. but the problem is reaching height and width properties of images
here is my code(i need the property in red part):

function thumbLoad() {
for (i=0; i<len; i++) {
array[i]=new Loader();
array[i].x=index;
array[i].y=2;
index=index+4+array[i].width;
array[i].load(new URLRequest(thumb[i]));
Frame.addChild(array[i]);
//Frame is the movieclip i load the images on
}
}

hulk
09-17-2007, 12:35 AM
ok, i solved the problem a little bit, but not completely

added event listener for loader object, array[i];

array[i].contentLoaderInfo.addEventListener(Event.COMPLETE , function(e:Event){
trace(e.target.height);
});

now i can reach the properties but how can i communicate with array[i] inside the event listener function?

springframework
09-17-2007, 08:31 AM
e.target should return array[i]

hulk
09-17-2007, 08:52 AM
no, it returns LoaderInfo object