Another Thumbnails Gallery Question. Help?

Hello. I am a new Flash user, and have been putting together a portfolio page with help from the Kirupa tutorials. My portfolio page is based on the “adding thumbnails” xml tutorial. I am almost there, but have encountered a problem with my thumbnails. I’ve searched the forums for an answer, but I think this is a unique issue. If anyone can offer advice I would really appreciate the help!

The problem:
My portfolio consists of several projects. Each project has one thumbnail image, and between 1-4 larger photos that need to load in the main area. So if you click on a thumbanil it will take you to the first image, then you can scroll through with the buttons to see the next photos.

The issue is the spacing between the thumbnails, it’s all crazy. Here’s a link to the swf so you can see what I mean: [URL=“http://www.erinhawley.ca/portfolioPF.html”]http://www.erinhawley.ca/portfolioPF.html

In my XML file, I listed all the images in order. Only the first image of each project has a line with the thumbnail location, as you can see here: [URL=“http://www.erinhawley.ca/images/gallery23A.xml”]XML file

I’m guessing that the thumbnails movie clip is adding blank space for thumbnails for each image, even if there is no thumb file.

Is there a way to code this so the spacing is relative to the previous thumb and ignores no-thumb instances??

Here’s my actionscript so you can see what I have already:

function loadXML(loaded) {if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
description2 = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
description2* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images/gallery23A.xml");
///////////////////////////////////// 
listen = new Object();
listen.onKeyDown = function() {
	if (Key.getCode() == Key.UP) {
		prevImage();
	} else if (Key.getCode() == Key.DOWN) {
		nextImage();
	}
};
Key.addListener(listen);
BACK_btn.onRelease = function() {
	prevImage();
};
FORWARD_btn.onRelease = function() {
	nextImage();
};
///////////////////////////////////// 
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
	if (p<(total-1)) {
		p++;
		if (loaded == filesize) {
			picture._alpha = 0;
			picture.loadMovie(image[p], 1);
			desc_txt.text = description[p];
			reg_txt.text = description2[p];
			picture_num();
		}
	}
}
function prevImage() {
	if (p>0) {
		p--;
		picture._alpha = 0;
		picture.loadMovie(image[p], 1);
		desc_txt.text = description[p];
		reg_txt.text = description2[p];
		picture_num();
	}
}
function firstImage() {
	if (loaded == filesize) {
		picture._alpha = 0;
		picture.loadMovie(image[0], 1);
		desc_txt.text = description[0];
		reg_txt.text = description2[0];
		picture_num();
	}
}
function thumbNailScroller() {
	// thumbnail code! 
	this.createEmptyMovieClip("tscroller", 1000);
	// change scroll speed to 10 if scroll needed
	scroll_speed = 0;
	tscroller.onEnterFrame = function() {
		if ((_root._xmouse>=thumbnail_mc._x) && (_root._xmouse<=thumbnail_mc._x+thumbnail_mc._width)) {
			if ((_root._ymouse>=(hit_right._y-1)) && (thumbnail_mc.hitTest(hit_right))) {
				thumbnail_mc._y -= scroll_speed;
			} else if ((_root._ymouse<=(hit_left._y+1)) && (thumbnail_mc.hitTest(hit_left))) {
				thumbnail_mc._y += scroll_speed;
			}
		} else {
			delete tscroller.onEnterFrame;
		}
	};
}


function thumbnails_fn(k) {
	thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
	tlistener = new Object();
	tlistener.onLoadInit = function(target_mc) {
		target_mc._y =(target_mc._height-9)*k;
		//trace(target_mc._width+" "+target_mc._parent._rotation)
		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);
}



Please help…I’m going bonkers trying to figure this out!!

Erin