# Gallery preloader problem

**URL:** https://forum.kirupa.com/t/gallery-preloader-problem/204297
**Category:** Uncategorized
**Created:** [October 18, 2006, 4:54pm UTC](https://forum.kirupa.com/t/gallery-preloader-problem/204297 "2006-10-18T16:54:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![friggingmick](https://avatars.discourse-cdn.com/v4/letter/f/58956e/32.png) [@friggingmick](https://forum.kirupa.com/u/friggingmick)
#### Post date: [October 18, 2006, 4:54pm UTC](https://forum.kirupa.com/t/gallery-preloader-problem/204297/1 "2006-10-18T16:54:38Z")

</div>

Based on Scotty’s awesome gallery demo (thread can be found @ [http://www.kirupa.com/forum/showthread.php?t=212112&highlight=slideshow](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:

```auto

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
