Hello Kirupa goers,
I basically had a gallery i was using for my website, but it was v simple and used embedded images for the thumbnails. i wanted to improve the gallery by using XML to load the thumbnails and main images.
I started experimenting with a few tutorials (im pretty new to XML) and got a very rough example working (sort of!). The problem is that some of the thumbnails arent loaded in the right order, and some of them are covering/overlapping other thumbnails.
My main AS code for the frame containing my 2 main movieclips (‘thumbLoader’ and ‘mainLoader’) is as follows:
*[FONT=Courier New]myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
[COLOR=Silver]//portfolioTag = this.firstChild;[/COLOR]
numimages = this.firstChild.childNodes.length;
spacing = 85;
yspacing = 65;
colcount = 0;
rowcount = 0;
for (i=0; i < numimages; i++) {
this.picHolder = this.firstChild.childNodes;
this.thumbHolder = thumbLoader.createEmptyMovieClip(“thumbnail”+i, i);
if (colcount * spacing > 180) {
colcount = 0;
rowcount++;
this.thumbHolder._y += yspacing;
this.thumbHolder._x = colcount;
} else {
if (rowcount > 0) {
this.thumbHolder._y = rowcount * yspacing;
}
this.thumbHolder._x = colcount * spacing;
colcount++
}
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() {
mainLoader.loadMovie(this.main);
captionTxt.text = this.title;
};
}
};
myPhoto.load(“gallery.xml”);
[/FONT]**[FONT=Courier New][FONT=Arial][COLOR=Black]My thumbLoader movieclip simply contains a shape where new empty movieclips are generated for each thumbnail. [/COLOR][/FONT]
[/FONT]
Here is an example of what ive got so far - note that thumbnails are not in the right order and only the ‘Personal’ section is accessible:
http://lauriedeandrivingschool.co.uk/ceh/testgal/xmlgallery.swf
(Sorry if this post is total garbage, im jus dam confused!)
ST