Preloader problem

In the first frame of my movie, I have the following code that adjusts the width of a preload bar (200px wide, hence the percent * 2) depending on how much is loaded.

var total:Number = getBytesTotal();
onEnterFrame = function(){
var loaded:Number = getBytesLoaded();
var percent:Number = Math.round((loaded/total)*100);
_root.preloadbar._width = percent * 2;
if(percent < 100){

When the movie is 61% loaded, the preload bar jumps straight to the end but the movie keeps on loading. Any ideas why this might be? I’m still fairly new to AS so excuse me if this is a bit of a n00b question :slight_smile: