Preloader works but movie stops after preloader is finished

Hello everyone,

  I am having a peculiar problem with the preloader script I am using in Flash MX. Please take a look at the script:

//stops the frames, so we donft leave the preloader before every thing is loaded
stop();
//declare the variable that will hold the loaded bytes
var loaded_bytes = 0;
//variable for the total bytes
var total_bytes = 0;
//the percentage in numbers
var percentage;
//the percentage with "%" , used in the dynamic text
var percentageText = "";
this.onEnterFrame = function()
{
    total_bytes = _root.getBytesTotal();
    loaded_bytes = _root.getBytesLoaded();
    percentage = Math.round(loaded_bytes / total_bytes * 100);
    bar._xscale = percentage;
    percentageText =percentage + "%";
    if (loaded_bytes == total_bytes) {
        gotoAndPlay(2);
    }
}

The script looks fine; however, when the content is finished loading and the if statement is run, then the movie goes to the 2nd frame and just stops. There is no stop statement on the 2nd frame. If you’d like the .fla file just PM me for it or message me on MSN at z_freelance@hotmail.com.

Thank you,
-Epsilon Delta