Code not working

Hi everyone,

I have the following preloader code:

stop();

CheckProgress = setInterval(getPercent, 10);

function getPercent() {
	var currentBytes = _root.getBytesLoaded();
	var totalBytes = _root.getBytesTotal();
	var pctLoaded = Math.round(currentBytes/totalBytes*100);
	pct_txt.text = pctLoaded + "%";
	
	if(pctLoaded >= 100) {
		gotoAndStop(2);
		clearInterval(checkProgress);
	}
	
}

When the code checks to see if it’s finished loading, ie:

if(pctLoaded >= 100) {
                gotoAndStop(2);
                clearInterval(checkProgress);
        }

…it tells the playhead to go to frame 2, ie.

gotoAndStop(2);

There is a movieclip on this frame and inside, on its own timeline, there’s the following on the last frame:

_parent.nextFrame();

This tells the playhead to move to frame 3 on the root timeline which again contains another movie clip.

When I test, after the preloader has done it’s work, it moves to frame 2 and plays the mc but after that it doesn’t move to frame 3. It just loops the mc on frame 2.

It worked successfully before I put the preloader code in place, so I’m assuming it has something to do with that.

I wondered if anyone knows what might be happening?

Appreciate any help.