Scaling loaded XML gallery images

hi everyone,

i offered to help a friend with some actionscript problems he was having, i thought i knew what the problem was… but i find that i don’t!

he’s creating an XML gallery and wants to be able to know the width (and height) of the loaded images to use. The problem is, when he loads in his images, the listener just traces back the final image’s dimensions.

He has created separate thumbnail files, so the question isn’t about resizing the big image, but getting the values of the loaded thumbnail.

here’s the bit of code where the problem is (i reckon):

for (i=0; i<glryLength; i++) {
		var newThumb:MovieClip = _root.createEmptyMovieClip ("mcThumb" + i,this.getNextHighestDepth());
		//newThumb._x = imgThumb_X + (marginThumb + imgThumb_W) * i
		//newThumb._y = imgThumb_Y
		thumbLoader.addListener(thumbListener);
		thumbLoader.loadClip(glryThumb*, newThumb);
		
		thumbListener.onLoadInit = function() {
			trace(newThumb._width);
		}
	}

so it loads the images in fine, and then the trace returns
56
56
56
56

(there are four images, and the last one has a width of 56).
I’ve tried a lot of different things, but i just can’t quite get it!

thanks a lot
Stu

(p.s i know there is a good XML tutorial here at kirupa but i’m trying to work with what he already has!).