Photo Gallery using XML and Flash - Thumbnail Bug

Hi,
i am trying to use the gallery with Thumnails that i found in the tutorial part of the site.
I made the thumbnails vertical instead of horizontal.
But i dont think the problem comes from that.

here is the thing:

when loading the thumbnails, if the thumbnails if the thumbnails picture are in diferrent size it messes it al up.

here is the code that i adapted:

///////////////////////////////////////////////////////////////////////////////////////

function thumbnails_fn(k) { 
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth()); 
tlistener = new Object(); 
tlistener.onLoadInit = function(target_mc) { 
target_mc._y = hit_left._y+(eval("thumbnail_mc.t"+k)._height+5)*k; 
target_mc.pictureValue = k-1; 
target_mc.onRelease = function() { 
p = this.pictureValue; 
nextImage(); 
};

///////////////////////////////////////////////////////////////////////////////////////

I think the problem comes from this lign:

target_mc._y = hit_left._y+(eval("thumbnail_mc.t"+k)._height+5)*k

actually it places the movie according its own size assuming that all the previous movies in the loop where the same size. but they aren’t

I been trying to make it work for so long but i can t find a way to go around it

i hope someone will be able to help me
thanx

here is the link to the demo
http://phoenix68.9online.fr/daeja2.swf
as you can see the two last thumbnails assume than the 8 before them where the same size as they are …:frowning:

:*(

I’ve done the same tutorial and already modified some things, the scroller is now vertical and some other stuff…
But i also have the problem that the thumbs are not positioned correctly when i use different imagesizes.
I have tried the 2 daeja-files but it isn’t working, even if i change the mentioned line 110, the thumbs are still messed up…(all load on the same position)

another problem is the scroller. If you move the mousecursor over the “scroll-area” but haven’t moved the cursor over a thumbnail the scroller wont work

here you can look at the swf:
http://noiserus.de/st-test/test/xml_photogallery_user.swf

here is the fla:
http://noiserus.de/st-test/test/xml_photogallery_user.fla

thx in advance…

In your fla is still the ‘old’ code, you should load the thumbs in a sequence

function thumbnails_fn() {
	//clear the interval
	clearInterval(thumbdelay);
	thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
	//define the previous thumb
	var prevThumb = this["thumbnail_mc"+(k-1)];
	tlistener = new Object();
	tlistener.onLoadInit = function(target_mc) {
		//set the y position
		if (k>0) {
			target_mc._y = prevThumb._y+prevThumb._height+5;
		} else {
			target_mc._y = hitleft._y;
		}
		target_mc.pictureValue = k-1;
		target_mc.onRelease = function() {
			p = this.pictureValue;
			nextImage();
		};
		target_mc.onRollOver = function() {
			this._alpha = 50;
			thumbNailScroller();
		};
		target_mc.onRollOut = function() {
			this._alpha = 100;
		};
		//call function nextThumb
		nextThumb();
	};
	image_mcl = new MovieClipLoader();
	image_mcl.addListener(tlistener);
	image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
function nextThumb() {
	k<total-1 ? (k++, thumbnails_fn()) : null;
}

scotty(-:

thx for the fast reply…

but it doesn’t work…

when i paste the code in daeja2.fla the thumbs are still on the same place.

but i’m currently trying something different:

function thumbnails_fn(k) {
	thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
	tlistener = new Object();
	tlistener.onLoadInit = function(target_mc) {
		var help = ("thumbnail_mc.t"+k);
		var help2:Number = ;
		trace(help2);
		trace(help);
		target_mc._y = hit_left._y+(75+10)*k;
		target_mc.pictureValue = k;

i want to get the height of the movieclip carrying the thumb.
with the var ‘help’ i’m getting the current mc,
with the var ‘help2’ i want to get the height of that clip, but i’m not sure how to do it… what do i have to write there?
when i got it i just exchange “75” (in “target_mc._y = hit_left._y+(75+10)*k;”)and “help2”.

good idea???

edit:
uuups,
i need to get the height of the previous thumb so i would rather try
var help = (“thumbnail_mc.t”+(k-1));

then

var help = (“thumbnail_mc.t”+k);

In my code, change

var prevThumb = this["thumbnail_mc"+(k-1)];

in

var prevThumb = thumbnail_mc["t"+(k-1)];

scotty(-:

yeeeeeaaaaaaaaah, you’re the man…

that worked…now it is functioning properly…:thumb2:

no problem =)