function ScreenprintsLoad(screenprints_xml){
var screenprintsThumbs = screenprints_xml.firstChild.firstChild.childNodes;
maincontent.createEmptyMovieClip("holder", 1);
for(var i = 0; i<screenprintsThumbs.length; i++){
var currentPicture = screenprintsThumbs*;
var currentThumb = maincontent.holder.createEmptyMovieClip("thumb_mc"+i,i);
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.loadClip(currentPicture.attributes.largethumb,currentThumb);
var container:Object = new Object();
mcl.addListener(container);
container.onLoadInit = function(target:MovieClip) {
target._x = i * 100;
}
}
}
the xml structure is fine. But right now only the last thumb is showing.
I’ve used this method before to load one image, but not in a loop.
what am i doing wrong?
this is what I have now and it works.
function ScreenprintsLoad(screenprints_xml) {
var screenprintsThumbs = screenprints_xml.firstChild.firstChild.childNodes;
maincontent.createEmptyMovieClip("holder",1);
for (var i = 0; i<screenprintsThumbs.length; i++) {
var currentPicture = screenprintsThumbs*;
var currentThumb = maincontent.holder.createEmptyMovieClip("thumb_mc"+i, i);
currentThumb._x = i*80;
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.loadClip(currentPicture.attributes.largethumb,currentThumb);
var container:Object = new Object();
mcl.addListener(container);
container.onLoadInit = function(target:MovieClip) {
target._x = target._x-(target._width/2);
target._y = target._y-(target._height/2);
}
}
}
My problem is that I want to create a whiterectangle around every thumb.
I need the width and height properties from the onLoadInit. However it seems the onLoadinit doesnt loop, and only seems to take the argument target:MovieClip.
??