Hi all, dont think i’m too far away with this one, i am loading in a set of images from an XML file and i am trying to get each image to load into an image holder movie clip i have made.
this is my code thus far:
function callThumbs():void
{
for(var i:Number = 0; i < total; i++)
{
var projectNode:XML = projects*;// Get this project/row
var images:XMLList = projectNode.IMAGE;// Get the images out of this project/row
var imagesTotal:Number = images.length();
for (var j:Number = 0; j < imagesTotal; j++) {// Loop over these images (for just this project)
var thumb_url = images[j].@THUMB;
var thumb_loader = new Loader();
thumb_loader.load(new URLRequest(thumb_url));
thumb_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
thumb_loader.name = i + "_" + j;// The name will be row_column.
thumb_loader.x =(thumbHeight+10)* i;
thumb_loader.y =(thumbHeight+10)* j; // Position vertically by using "i" as a counter for our current row.
}
}
}
function thumbLoaded(e:Event):void{
var my_thumb:Loader = Loader(e.target.loader);
scrollbox.content.addChild(my_thumb);
my_thumb.contentLoaderInfo.removeEventListener(Event.COMPLETE, thumbLoaded);
}
i have tried a few things but can’t seem to find the correct code for it.
my holder is an mc with a second mc inside so is laid out like holder.imageHolder
if anybody could point me in the right direction i would be very grateful.
Regards
Dan