Help with script

I have a script for a pre-loader that I have been playing around with. Unfortunately at the moment it either creates a continuous loop or doesn’t work at all, depending on what I do with the script.

Can anyone suggest a solution?

The fla is included

the script works fine … you just place it at frame 2 not frame 1

Would I need a script in frame 1?

Also there is no else statement in the script, how does it continually test the if statement?

here you go … just make it like this