# Preloader Question

**URL:** <https://forum.kirupa.com/t/preloader-question/188928>\
**Category:** Uncategorized\
**Created:** [May 11, 2006, 10:05pm UTC](https://forum.kirupa.com/t/preloader-question/188928 "2006-05-11T22:05:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![njoay](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@njoay](https://forum.kirupa.com/u/njoay)\
**Post date:** [May 11, 2006, 10:05pm UTC](https://forum.kirupa.com/t/preloader-question/188928/1 "2006-05-11T22:05:12Z")

</div>

Hi,

My preloader only counts up to 40%, plays the first part of the scene and hangs until it reaches 100% and then the main movie clip plays. How can I modify my code so that it loads to a 100% first and then play the movie fluidly?

In frame 1:

onEnterFrame = function() {  
t = \_root.getBytesTotal()  
l = \_root.getBytesLoaded()  
p = int ( (l/t) \* 100 )  
\_root.percentLoaded.text = p; //percentLoaded is the instance name for my textbox  
//\_root.kilobytes.text = l+"kb of "+t+“kb”; //I DON’T USE THIS

```
if ( t == l && t &gt; 100 ) {
    delete _root.onEnterFrame;
            //gotoAndPlay("movie"); // I COMMENTED THIS OUT BECAUSE THE MOVIE RELOADS AT THIS POINT FOR SOME REASON
}

```

}

Frame 2:  
if (\_parent.getBytesLoaded() == \_parent.getBytesTotal()) {  
\_parent.gotoAndPlay(“movie”);  
}

Thanks
