I’ve tried a number of options, but nothing seems to work with my existing code. So I’m asking for help. Basically I’ve got a gallery that now needs to run automatically after 5 seconds. It’s a very basic XML driven gallery. Any help or ideas would be greatly appreciated!
Here’s my code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
rootNode = myPhoto.firstChild;
numimages = this.firstChild.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
spacing = 90;
xPos = 0;
yPos = 0;
for (i = 0; i < numimages; i++) {
this.picHolder = this.firstChild.childNodes*;
this.thumbHolder = thumbnails.empty2.createEmptyMovieClip("thumbnail" + i, i);
this.thumbHolder._x = xPos;
this.thumbHolder._y = yPos;
xPos += spacing;
if(xPos == 180) {
xPos = 0;
yPos += 70;
}
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage", 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.gotoAndPlay("start");
loader.empty.loadMovie(this.main);
title_txt.text = this.title;
};
}
};
//myPhoto.load("/files/flash/gallery1/xmlphoto.xml");
myPhoto.load("xmlphototest.xml");
//loader.empty.loadMovie("/files/flash/gallery1/img/image-1.jpg");
loader.empty.loadMovie("img/image-1.jpg");
stop();
And here are my files, including the XML and images.