# Preloader issues

**URL:** <https://forum.kirupa.com/t/preloader-issues/224515>\
**Category:** Uncategorized\
**Created:** [May 2, 2007, 11:44pm UTC](https://forum.kirupa.com/t/preloader-issues/224515 "2007-05-02T23:44:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BetaWar](https://avatars.discourse-cdn.com/v4/letter/b/e79b87/32.png) [@BetaWar](https://forum.kirupa.com/u/BetaWar)\
**Post date:** [May 2, 2007, 11:44pm UTC](https://forum.kirupa.com/t/preloader-issues/224515/1 "2007-05-02T23:44:10Z")

</div>

Well I am trying to create a preloader and it worked in theory but when I attempt to implement it is won’t work.

I think it has to do with my AS but am not sure

Here is th as:

```auto
function preLoader(loadIt) {
 if (getBytesLoaded()>4 && getBytesLoaded() == getBytesTotal()) {
  gotoAndPlay("start");
 } 
 else {
  pct = int(getBytesLoaded()/getBytesTotal()*100);
  for(i=prevPct;i<pct;i++){
   loadBar.pct.attachMovie("percentage", "p"+i, _root.loadBar.pct.getNextHighestDepth(), {_x:0, _y:0, percent:i});
   prevPct = pct;
   trace("Percent: " +pct+ " Previous: " +prevPct);
  }
  gotoAndPlay("load");
 }
}
audio = new Sound();
audio.loadSound('sounds/OrdonTheme.mp3', false);
audio.volume =100;
audio.start();
_root.attachMovie('preLoader', 'loadBar', _root.getNextHighestDepth(), {_x:((550-200)/2), _y:((400-20)/2)});
preLoader(_root);

```

The preLoader(\_root); is for something that I was attempting and didn’t turn out to work so I am going to come back to it.

The issue is that it moves on to the start frame before loading all (or any) of the percentages into loadBar (as it is supposed to) I am not sure what is wrong here but any help would be great.

If you want me to attach the whole file just ask.
