# Preloader too slow?

**URL:** <https://forum.kirupa.com/t/preloader-too-slow/232871>\
**Category:** Uncategorized\
**Created:** [July 18, 2007, 12:39pm UTC](https://forum.kirupa.com/t/preloader-too-slow/232871 "2007-07-18T12:39:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![masskontroll](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@masskontroll](https://forum.kirupa.com/u/masskontroll)\
**Post date:** [July 18, 2007, 12:39pm UTC](https://forum.kirupa.com/t/preloader-too-slow/232871/1 "2007-07-18T12:39:17Z")

</div>

Just made a basic preloader, using action script to move the playhead along the timeline of an mc until it reaches the end (last frame being 100% loaded). However: the playhead on the root timeline already skips to the next frame of the website before the complete preloader animation has run! When ca. 85-90 % is loaded, the playhead already continues to the rest, the preloader is never fully played. What can be done?

This is the script I used:

First frame on the root:

stop();

onEnterFrame = function(){

```
var percent_loaded = _root.getBytesLoaded()/_root.getBytesTotal();
preloader_mc.value = percent_loaded;

if (percent_loaded == 1){
    delete onEnterFrame;
    play();
}

```

}

On the preloader mc:

var value = 0;

onEnterFrame = function(){  
var frame = 1 + Math.round((animation\_mc.\_totalframes - 1) \* value);  
animation\_mc.gotoAndStop(frame);  
}

onEnterFrame();
