# Problem with preloader

**URL:** <https://forum.kirupa.com/t/problem-with-preloader/277233>\
**Category:** Uncategorized\
**Created:** [December 9, 2008, 8:17pm UTC](https://forum.kirupa.com/t/problem-with-preloader/277233 "2008-12-09T20:17:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcelomdsc](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@marcelomdsc](https://forum.kirupa.com/u/marcelomdsc)\
**Post date:** [December 9, 2008, 8:17pm UTC](https://forum.kirupa.com/t/problem-with-preloader/277233/1 "2008-12-09T20:17:25Z")

</div>

hello, I´m using a preloader created using the technique shown here…  
[http://www.gotoandlearn.com/play?id=18](http://www.gotoandlearn.com/play?id=18)  
It worked fine last time I used it, but this time, the preloader only shows up after about 60% of the page has already loaded, which might be too long.

My question is, is there anyway to avoid that?  
Maybe adding a updateAfterEvent somewhere in the AS code?

thanks.

PS: here is the code used…  
on frame 1…  
var amountLoaded:Number = \_root.getBytesLoaded() / \_root.getBytesTotal();  
preloader.\_width = amountLoaded \* 400;

on frame 2…  
if (\_root.getBytesLoaded() == \_root.getBytesTotal()) {  
gotoAndPlay(3);  
}  
else {  
gotoAndPlay(1);  
}
