This is my AS to import the XML and make the thumbnails link to full size images.
Code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
var count:Number = 0; // Variable that counts how many movieclips have rendered thus far
var yPos:Number = 0; // Initial _y coordinate of the first row
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages = this.firstChild.childNodes.length;
spacing = 51;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
getURL("javascript:LightboxDelegate(\'images/" + images[this.id] + "\',\'" + captions[this.id] + "\')", "");
}
if (count == 8) { // if count = 4, we're at the end of the row
count = 0; // reset count to 0
yPos = yPos + 70; // incease the _y coordinate for the next row (100 = height of element plus padding)
}
this.thumbHolder._y = count*spacing // set _x coordinate
this.thumbHolder._x = yPos; // set _y coordinate
count++; // increase count by 1
};
};
myPhoto.load("wedding.xml");
is the "this." code causing a conflict? Since it appears as "this.thumbHolder".
I hope this wont cause me to have to scrap this script and start with another one.
Bookmarks