Hello,
I am loading a few thumbnails from XML.
When they load in, I want them to perform a few simple functions.
However, when I load them in, Only the LAST thumbnail takes the onLoadInit() function.
Can you help me out?
function AttachThumbs(xmlData)
{
xmlNode = xmlData.firstChild.childNodes;
var total:Number = xmlNode.length;
thumb = *;
for(i=0;i<total;i++)
{
thumb* = xmlNode*.attributes.thumb;
var thumbX:Number = i*dimension;
nav = _root.attachMovie("thumb","thumbs"+i,i,{_x:thumbX});
var tLoader:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
tLoader.addListener(loadListener);
loadListener.onLoadInit = function()
{
nav._x = -(dimension/2);
nav._y = -(dimension/2);
trace("OK!");
}
tLoader.loadClip(thumb*,nav);
}
}
It’s as if I need to create multiple loadListener objects… one for each thumbnail, but I dont know how to do that when declaring a variable … ie: one cant say:
var ["loadObject"+i]:Object = new Object();
Ok thanks if you can help!!