rendered paste bodytheXML.onLoad = function(bSuccess:Boolean) {
if(bSuccess) {
aImages = mx.xpath.XPathAPI.selectNodeList(this.firstChild,"/*/button");
iLen = aImages.length;
var thumbCont:MovieClip = bigCont.createEmptyMovieClip("thumbCont",bigCont.getNextHighestDepth());
for(i=0;i<iLen;i++) {
var theThumb:MovieClip = thumbCont.createEmptyMovieClip("thumb"+i,thumbCont.getNextHighestDepth());
var iCont:MovieClip = theThumb.createEmptyMovieClip("thumbImage",theThumb.getNextHighestDepth());
theThumb._id = i;
theThumb._imageFile = this.firstChild.childNodes[i].attributes.image;
theThumb._caption = this.firstChild.childNodes[i].attributes.caption;
thumbLoader.loadClip(this.firstChild.childNodes[i].attributes.thumb,iCont);
theThumb.onRelease = function() {
loadImage(this._id);
//theLoader.loadClip(this._imageFile,viewer.iCont);
theCaption.text = this._caption;
currentIndex = this._id;
}
theThumb._x = lastX*40;
theThumb._y = lastY*40;
if(lastX == rowNum) {
lastX = 0;
lastY++;
}
//if(i%rowNum == 0) {
//lastY += 50;
//lastX = 0;
//}
//else {
///lastX += 50;
//lastY += 0;
//}
}
loadImage(currentIndex);
}
}