# Preloader

**URL:** <https://forum.kirupa.com/t/preloader/282844>\
**Category:** Uncategorized\
**Created:** [February 27, 2009, 1:40am UTC](https://forum.kirupa.com/t/preloader/282844 "2009-02-27T01:40:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel\_mihalcea](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@daniel\_mihalcea](https://forum.kirupa.com/u/daniel_mihalcea)\
**Post date:** [February 27, 2009, 1:40am UTC](https://forum.kirupa.com/t/preloader/282844/1 "2009-02-27T01:40:56Z")

</div>

Hello. I am working on a photo gallery and I am trying to make a preloader. But something is wrong.  
I am using this code:

function startLoading(whichImage) {  
\_root.onEnterFrame = function() {  
infoLoaded = imageLoader.getBytesLoaded();  
infoTotal = imageLoader.getBytesTotal();  
percentage = Math.floor(infoLoaded/infoTotal\*100);  
infoField.text = percentage + " %";  
if (percentage \>= 100) {  
loadMovie(whichImage, “imageLoader”);  
delete this.onEnterFrame;  
infoField.\_visible = false;  
}  
};  
}

The problem is that infoField is showing only 0% and 100%.  
Could someone guide me to the right way?  
And for example if I have an xml file and load thumbnails from it how do I show the progress for each thumbnail or in a text box something like this: 5/10 loaded.  
Thank you.
