Gallery preloader problem

Based on Scotty’s awesome gallery demo (thread can be found @ http://www.kirupa.com/forum/showthread.php?t=212112&highlight=slideshow).

I modified the preloader function to use a customized preloader (play 100 frames) instead of simple width preloader. I can’t get the preloader to work and my brain basically is on the writer’s block and can’t come up any solution idea. The problem lies with var precent:Number… and can’t com up with something to replace “con._width” since this is intended for the width preloader…

preloader function:


function preloadPic() {
	clearInterval(id);
	var con = picture.duplicateMovieClip("con"+k, 9984+k);
	con.loadMovie(image[p]);
	preloader._visible = 1;
	preloader.swapDepths(con.getDepth()+3);
	con._alpha = 0;
	var temp = _root.createEmptyMovieClip("temp"+k, 99+k);
	k++;
	temp.onEnterFrame = function() {
		var total = con.getBytesTotal();
		var loaded = con.getBytesLoaded();
		var percent:Number = Math.round(loaded/total*100);
		preloader.gotoAndStop(percent);
		if (con._width) {
			preloader._visible = 0;
			con.onEnterFrame = fadeIn;
			if (slide) {
				id = setInterval(nextImage, 5000);
			}
			delete this.onEnterFrame;
		}
	};
}

any suggestion?

Friggin’ Mick