Preloader Question

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 > 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