as2 preloader glitch

Hi all,

I’ve just built a site using mx2004 and as2, that’s around 6MB in size. I stuck a very simple preloader on using the following code in frame 1:

<as>
stop ();

var loaderInterval = setInterval (loading,10);
function loading () {
percent_txt.text = Math.round (getBytesLoaded ()/ getBytesTotal ()*100)+"%";
if (getBytesLoaded () >= getBytesTotal () ){
gotoAndPlay (“intro”);
percent_txt._visible = false;
clearInterval (loaderInterval);
}
}
</as>

on a preloader layer, I have nothing but a dynamic Text field, called percent_txt.

The thing is, it won’t show anything until around 90% of the way through the load. when magically the preloader text appears for the last second (starting at 90%). I’ve tried it on another movie and it works exactly as it should. Any ideas why? What am I doing wrong!!! I’m beginning to pull my hair out over this. I’m simulating a download speed of 1MB/s and also uploaded the partial movie to a server. No good.

Any ideas would be gratefully received.
Cheers, Simon

ps I’m a complete noob, and if it wasn’t for the likes of you guys I’d still be trying to work out why the hell I tried flash in the first place, so keep up the fantastic work!