Code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("xmlphoto.xml");
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 70;
for (i=0; i<numimages; i++) {
picHolder = this.firstChild.childNodes[i];
this.thumbHolder = _root.thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image"+i, i);
this.thumbLoader.loadMovie(picHolder.attributes.thmb);
//create new movie and then load the thumbnails into it.
thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
};
This is what you need to have Flash recognize the XML. Obviously replacing instance names with your own.
Bookmarks