Preloader for XML Gallery not working

Ok… I have searched and searched and can’t seem to figure this one out. I have a preloader for each of the images (loaded with XML) in my gallery. I’m trying to get the percent to show up. I got fed up and deleted the percentage part of the preloader it all together… But now I really need one in there. Does anyone have a clue how to code this? Here’s the AS for the preloader bar I have so far:

this.onEnterFrame = function() {
	filesize = container.getBytesTotal();
	loaded = container.getBytesLoaded();
	preloader._visible = true;
	if (loaded != filesize) {
		preloader.preload_bar._xscale = 100*loaded/filesize;
	} else {
		preloader._visible = false;
		if (container._alpha<100) {
			container._alpha += 10;
		}
	}
};

Thank you to anyone that can help!