Loading Images in order

Ok, created an imageviewer using xml. I’m creating thumbnails, using both external swf’s and jpeg’s. My problem is, I want the thumbnails to load in order. For example, all the jpg’s will load faster than the swfs, and it will look like I have blank spots where thumbnails are supposed to be. How can I make sure on is loaded in the for statement before loading the next? For some reason I can’t target it use getBytesLoaded()/Total(). This code is my function to create the thumbnails. Any help is appreciated. You can go to: http://www.darrenbaldwin.com/work/imageviewer.html to see an example of what I’m talking about.

(I’ve also read all the tutorials about xml gallerys and preloading on here, and can’t quite find the answer, but maybe I missed it)


function createMenu(b) {
	myNum = 0;
	a = viewerXML.childNodes[0].childNodes**.childNodes[1];
	_root.Arrows.removeMovieClip();
	if (a.childNodes.length>5) {
		_root.attachMovie("Arrows", "Arrows", 7);
		_root.Arrows._x = 124.5;
		_root.Arrows._y = 15.8;
	}
	_global.where = a;
	this.createEmptyMovieClip("menu", 8);
	menu._x = 19;
	menu._y = 6;
	menu.setMask(mask);
	for (i=0; i<a.childNodes.length; i++) {
 clip = menu.createEmptyMovieClip(a.childNodes*.childNodes[0].childNodes[0].nodeValue, i);
		clip.createEmptyMovieClip("image", 1);
		clip.image.loadMovie(a.childNodes*.childNodes[1].childNodes[0].nodeValue, i);
		trace(clip.image.getBytesTotal())
		clip.image._xscale = clip.image._yscale=7;
		clip.btn_name.text = a.childNodes*.childNodes[0].childNodes[0].nodeValue;
		clip._x = (clip._width+45)*(i);
		clip.name = a.childNodes*.childNodes[0].childNodes[0].nodeValue;
		clip.imageName = a.childNodes*.childNodes[1].childNodes[0].nodeValue;
		clip.imageDesc = a.childNodes*.childNodes[2].childNodes[0].nodeValue;
		clip.ivar = i;
}
}