Hey guys,
I’ve adapted the xml photogallery on this site to preload the image, but I would like to also be able to preload thumbnails (individually)
Here’s the code so far:
gallery=1
loadVariablesNum("http://www.substratemedia.com/IGPC/gallery_Display.php", 0, "POST");
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages = this.firstChild.childNodes.length;
spacing = 85;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes*;
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
if (i>=3) {
this.thumbHolder._y= 60;
this.thumbHolder._x= (i-3)*spacing;
}
if (i>=6) {
this.thumbHolder._y=120;
this.thumbHolder._x= (i-6)*spacing
}
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() {
loader.loadMovie(this.main);
this.onEnterFrame=function() {
totalBytes = loader.getBytesTotal();
bytesWritten = loader.getBytesLoaded();
percent = bytesWritten/totalBytes *100
galleryPreloader._visible = true
galleryPreloader.bar._width= 1.88 *percent
if (percent >99) {
galleryPreloader._visible=false
}
}
title_txt.text = this.title;
};
}
};
myPhoto.load("xmlphoto.xml");
I can’t seem to be able to trace getBytesTotal() for any of the thumbnails. Any advise? I appreciate the time everyone