# Speed up photo gallery

**URL:** <https://forum.kirupa.com/t/speed-up-photo-gallery/114984>\
**Category:** Uncategorized\
**Created:** [July 4, 2004, 7:42am UTC](https://forum.kirupa.com/t/speed-up-photo-gallery/114984 "2004-07-04T07:42:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![huynhsanity](https://avatars.discourse-cdn.com/v4/letter/h/b9bd4f/32.png) [@huynhsanity](https://forum.kirupa.com/u/huynhsanity)\
**Post date:** [July 4, 2004, 7:42am UTC](https://forum.kirupa.com/t/speed-up-photo-gallery/114984/1 "2004-07-04T07:42:45Z")

</div>

Hello,

I was wondering if anyone knows of a way to speed up the transition time between pictures for this slideshow: [http://www.kirupa.com/developer/mx/photogallery.html](http://www.kirupa.com/developer/mx/photogallery.html)

There is too much of a lag for larger images. Go here to see what I mean: [http://www.vuhuynh.com](http://www.vuhuynh.com)

Is there a way to perhaps preload all images or put a preloader that displays progress while each image loads?

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 4, 2004, 9:26am UTC](https://forum.kirupa.com/t/speed-up-photo-gallery/114984/2 "2004-07-04T09:26:16Z")

</div>

Have a look in the code for this part:

```auto
MovieClip.prototype.loadMeter = function() {
	var i, l, t;
	l = this.photo.getBytesLoaded();
	t = this.photo.getBytesTotal();
	if (t>0 && t == l) {
		this.onEnterFrame = fadeIn;
	} else {
		trace(l/t);
	}
};

```

you can put the code for the preloader where the “trace(l/t)” now is.  
So if you have a (dynamic) textfield with the instancename “loadInfo” and a loadbar with instancename “loadBar” [size=1](both w/o quotes)[/size], you can change the code like this:

```auto
MovieClip.prototype.loadMeter = function() {
	var i, l, t;
	l = this.photo.getBytesLoaded();
	t = this.photo.getBytesTotal();
      percent = Math.round((l/t)*100);
	if (t>0 && t == l) {
		this.onEnterFrame = fadeIn;
	} else {
		loadInfo.text = percent+" % loaded";
loadBar._xscale= percent;
	}
}

```

scotty(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 4, 2004, 4:09pm UTC](https://forum.kirupa.com/t/speed-up-photo-gallery/114984/3 "2004-07-04T16:09:05Z")

</div>

Scotty,

Thanks for the quick reply. :hr:

I used your code, and the preloader works, but it does not ever reach 100% and it doesn’t dissapear off the screen.  
Take a look:  
[http://www.vuhuynh.com](http://www.vuhuynh.com/) (the preloader is on the bottom right)

Thanks again.

I’ve attached the .fla for your enjoyment ; ).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 4, 2004, 4:19pm UTC](https://forum.kirupa.com/t/speed-up-photo-gallery/114984/4 "2004-07-04T16:19:07Z")

</div>

sorry…here it is. I couldn’t include any of the images…the file would have been too big.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 4, 2004, 4:24pm UTC](https://forum.kirupa.com/t/speed-up-photo-gallery/114984/5 "2004-07-04T16:24:38Z")

</div>

```auto
MovieClip.prototype.loadMeter = function() {
	var i, l, t;
	l = this.photo.getBytesLoaded();
	t = this.photo.getBytesTotal();
      percent = Math.round((l/t)*100);
	if (t>0 && t == l) {
		this.onEnterFrame = fadeIn;
                         loadInfo.text = ""; //Add this
	} else {
		loadInfo.text = percent+" % loaded";
loadBar._xscale= percent;
	}
}

```

do this and the text will disappear when the 100% is reached, you don’t see 100% but who cares you get to see the picture\>\>\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 4, 2004, 4:36pm UTC](https://forum.kirupa.com/t/speed-up-photo-gallery/114984/6 "2004-07-04T16:36:50Z")

</div>

You Guys Rock!
