I am trying to make a photo gallery and I have succeed in importing the
pictures from XML into Flash. There are still two problems:
1. The content is loading into a movieclip and I tried to place a scroll pane
on the stage to adding scrolling capabilities. I set the parameters to control
the movieclip that holds the thumbnails but it is not making a scroll bar. I
can see the pictures inside of the scroll pane but it will not scroll to show
the rest of the pictures.
2. I can not figure out how to space the thumbnails evenly. I made a variable
and multiplied the x position of each picture by it but there are large
differences between landscape and portrait pictures.
Thanks for the help
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("events.xml");
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 70;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*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);
title_txt.text = this.title;
};
}
};
BrnstormWilly - 12 Aug 2008 16:45 GMT
You need to switch from using loadMovie to using the MovieClipLoader object.
This object has a listener called "onLoadInit" that allows you to get the size
of your photo when it comes in, but before it appears on stage, so that you can
adjust its placement. Check out the help docs for info on usage.
WL