Preloader... what stops it loading rest of frames?

Hi everyone…

I was curious how exactly this works… See below for actionscript i use… i put it in the frames before my animation… but how does it load the first few frames ie. loading bar etc… and then load the rest of the flash almost seperately?

FRAME1:
totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024);
percentDone = Math.round((loadedBytes / totalBytes) * 100);
if (_root._framesloaded>= _root._totalframes) {
gotoAndPlay(“start”);
}

FRAME2:
gotoAndPlay(1);

PRELOADER BAR:
onClipEvent (enterFrame) {
_xscale = _root.percentDone;
}