hi,
i am creating an adaptation of the xml gallery with thumbnails tutorial from this site, but i want to use vertical and horizontal images, with the same height, but varying widths as thumbnails. the code from the tutorial uses
the movie clip loader class with this code:
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
the x location of each new thumbnail_mc.t[k] is determined by this line:
target_mc._x = hit_left._x+(target_mc._width+5)*k;
problem is that in order for the spacing to be right all of the thumbnails have to be the same width. what i want to do is have the new thumbnails_mc.t[k] x value equal the x value of the previous thumbnail_mc.t[k] plus the width of the previous thumbnail_mc.t[k] plus 5 px.
So my question is how do I code that?
I’ve tried to create a variable by placing this in the onLoadInit function, but it comes back undefined.
var ptx = thumbnail_mc.t[k-1]._x;
var ptw = thumbnail_mc.t[k-1]._width;
i’m just not sure how to get the x value and width of the previously loaded thumbnail. if i had that i could easily keep the spacing right. Any help would be greatly appreciated.
m