# Why does my preloader load prematurely?

**URL:** <https://forum.kirupa.com/t/why-does-my-preloader-load-prematurely/246299>\
**Category:** flash\
**Created:** [December 9, 2007, 10:03pm UTC](https://forum.kirupa.com/t/why-does-my-preloader-load-prematurely/246299 "2007-12-09T22:03:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pimsme](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@pimsme](https://forum.kirupa.com/u/pimsme)\
**Post date:** [December 9, 2007, 10:03pm UTC](https://forum.kirupa.com/t/why-does-my-preloader-load-prematurely/246299/1 "2007-12-09T22:03:04Z")

</div>

I have this preloader code that should not play frame 3 until it is all loaded, but for some reason while my prelaoder bar is showing progess, frame 3 is already loaded. Can anyone tell me why? Here is my code below:

//frame 1:

bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
this.loadBar.\_width = getPercent_580;  
this.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}

//frame 2:

gotoAndPlay(1);
