# Why isn't it working?

**URL:** <https://forum.kirupa.com/t/why-isnt-it-working/199394>\
**Category:** flash\
**Created:** [September 1, 2006, 11:04pm UTC](https://forum.kirupa.com/t/why-isnt-it-working/199394 "2006-09-01T23:04:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dec27](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@dec27](https://forum.kirupa.com/u/dec27)\
**Post date:** [September 1, 2006, 11:04pm UTC](https://forum.kirupa.com/t/why-isnt-it-working/199394/1 "2006-09-01T23:04:25Z")

</div>

Hi!

I’m working on a gallery… yes, once again, but I can get the preload part to work.

I’m using xml to load images, but there’s a function which is not working, any help would be greatly appreciated.

This is it:

```auto

// this is the function that is not working
dislpayPicture = function () {
	holder = theScene.createEmptyMovieClip("holder", 1050);
	holder._x = -400;
	holder._y = -300;
	holder.boton = theScene.holder.createEmptyMovieClip("button", 0);
	holder.boton._alpha = 0;
	this.onEnterFrame = function() {
		var bytes_loaded = holder.boton.getBytesLoaded();
		var bytes_total = holder.boton.getBytesTotal();
		var percent_loaded = Math.round((bytes_loaded/bytes_total)*100);
		if (percent_loaded == 100) {
			holder.boton._alpha += 10;
			holder.onRelease = unloadImage;
			delete this.onEnterFrame;
		}
	};
};

```

Thanks in advanced.  
🙂
