# Preloader

**URL:** https://forum.kirupa.com/t/preloader/150694
**Category:** Uncategorized
**Created:** [June 9, 2005, 4:25pm UTC](https://forum.kirupa.com/t/preloader/150694 "2005-06-09T16:25:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kirupafan01](https://avatars.discourse-cdn.com/v4/letter/k/cab0a1/32.png) [@kirupafan01](https://forum.kirupa.com/u/kirupafan01)
#### Post date: [June 9, 2005, 4:25pm UTC](https://forum.kirupa.com/t/preloader/150694/1 "2005-06-09T16:25:25Z")

</div>

I have a drop in preloader bar, it has the actionscript preloaded in the movie clip. It works fine in most of the flash movies that i have but just finishing up this new one and dropping it in… it does not show the loader movie clip till about 50%. Here’s the script.

```auto

// this will get the total bytes loaded up to now
bytesLoaded = (_level0.getBytesLoaded());
// 
// this will get the total Kilobytes loaded up to now
KbytesLoaded = (int(_level0.getBytesLoaded()/1024) add "KB");
// 
// this will get the total bytes of the movie
bytesTotal = (_level0.getBytesTotal());
// 
// this will get the total Kilobytes of the movie
KbytesTotal = (int(_level0.getBytesTotal()/1024) add "KB");
// 
// this will set up the percentage of the movie loaded
percentSetup = ((bytesLoaded/bytesTotal)*100);
// 
// this will put the percentage result in the text box
percentage = int(percentSetup) add "%";
// 
// this will set the loader bars scale property to 0 in the
// beginning but it will expand as the percent level goes up.
setProperty("_root.DropIn.LoaderBar", _xscale, percentSetup);
// 
// this will check to see if the movie is loaded yet. If not
// it will go to frame 2 and basically start over at frame
// 1. In other words it will go back to the beginning of
// the script above.
if (bytesLoaded == bytesTotal) {
	_root.gotoAndPlay(2);
}

```

* * *

All of that is on the first frame, and on the second frame of the movie clip:

```auto

if (bytesLoaded<bytesTotal) {
	_root.DropIn.gotoAndPlay(1);
}

```

* * *

Now my full flash file is about 19 scenes long, would this effect it?  
If not, what other reason would this script be giving me a problem?  
Yes, the preloader script is in the first frame of the first scene.

Thanks for your help  
-Bust
