# Preloader for XML Gallery not working

**URL:** https://forum.kirupa.com/t/preloader-for-xml-gallery-not-working/228257
**Category:** flash
**Created:** [June 6, 2007, 3:13pm UTC](https://forum.kirupa.com/t/preloader-for-xml-gallery-not-working/228257 "2007-06-06T15:13:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![88635csi](https://avatars.discourse-cdn.com/v4/letter/8/c5a1d2/32.png) [@88635csi](https://forum.kirupa.com/u/88635csi)
#### Post date: [June 6, 2007, 3:13pm UTC](https://forum.kirupa.com/t/preloader-for-xml-gallery-not-working/228257/1 "2007-06-06T15:13:03Z")

</div>

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:

```auto
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!
