# Problem with preloader

**URL:** <https://forum.kirupa.com/t/problem-with-preloader/84109>\
**Category:** Uncategorized\
**Created:** [March 24, 2005, 5:32pm UTC](https://forum.kirupa.com/t/problem-with-preloader/84109 "2005-03-24T17:32:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kruption](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kruption/32/1202_2.png) [@kruption](https://forum.kirupa.com/u/kruption)\
**Post date:** [March 24, 2005, 5:32pm UTC](https://forum.kirupa.com/t/problem-with-preloader/84109/1 "2005-03-24T17:32:29Z")

</div>

Preloader code is in it’s own scene. It loads larger files (350k) fine but it doesn’t display until 70% for smaller files (17k). Using mx2004.

Here’s the code frame 1

```auto

loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
	gotoAndStop(_root.frame);
}
if (loadedbytes == totalbytes) {
	nextScene();
}

```

and frame 2

```auto

gotoAndPlay(2);

```

Thanks for any help.
