Simple preloader help

[CS3 AS2]
I’m having trouble preloading a site i’m working on. I think i’m doing it correctly but the preloader page dosen’t show up until its done loading. then jumps straight to the 2nd frame because its loaded.

I’m just doing a simple animation on frame 1 (as the preloader anim.) then when its finished loading, goToAndPlay frame 2. Any help would be appreciated.

my code:

total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();

if (loaded == total) {
_root.gotoAndPlay(2);
}