# Preloader doesn't show fast enough

**URL:** <https://forum.kirupa.com/t/preloader-doesnt-show-fast-enough/154488>\
**Category:** flash\
**Created:** [July 10, 2005, 7:28am UTC](https://forum.kirupa.com/t/preloader-doesnt-show-fast-enough/154488 "2005-07-10T07:28:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CayoHueso](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@CayoHueso](https://forum.kirupa.com/u/CayoHueso)\
**Post date:** [July 10, 2005, 7:28am UTC](https://forum.kirupa.com/t/preloader-doesnt-show-fast-enough/154488/1 "2005-07-10T07:28:11Z")

</div>

Hi everybody, I have created a preloader, but when I open the movie online. the preloader doesn’t show until the loading bar is at 50% at least.

Is there any reason for this to happens? I would like it to show up from 0%.

Here is the code:  
//this is first frame of the movie  
stop();  
//this is to load a background image randomly  
var randomNumber:Number = 1 + random(5);  
var randomBackground:String = “background\_images/background” + randomNumber.toString() + “.jpg”;  
background\_mc.createEmptyMovieClip(“imageHolder\_mc”, 1);  
background\_mc.imageHolder\_mc.loadMovie(randomBackground);  
background\_mc.\_visible = false;  
//SCRIPT FOR THE PRELOADER  
this.onEnterFrame = function() {  
loadedB = background\_mc.imageHolder\_mc.getBytesLoaded();  
totalB = background\_mc.imageHolder\_mc.getBytesTotal();  
totalBytes = this.getBytesTotal() + this.totalB;  
loadedBytes = this.getBytesLoaded() + this.loadedB;  
if (loadedBytes != totalBytes) {  
this.preloader\_mc.title\_txt.text=“LOADING INTERFACE”  
percent = Math.floor(100 \* loadedBytes / totalBytes);  
this.preloader\_mc.preloaderBar\_mc.\_xscale = percent;  
this.preloader\_mc.percent\_txt.text = percent + “%”;  
} else {  
\_root.background\_mc.\_visible = true;  
\_root.createEmptyMovieClip(“transition”, 2);  
\_root.transition.attachMovie(“cojones”, “cojones2”, 3);  
background\_mc.setMask(\_root.transition);  
this.preloader\_mc.\_alpha -= 10;  
if (this.preloader\_mc.\_alpha \<= 0) {  
delete this.onEnterFrame;  
\_root.gotoAndStop(“InitialAnimation”);  
}  
}  
};
