Preloader Idea

Ok heres my idea:
Percent = out of 100%
So if I made a movie clip and on the timeline of that movieclip made a 100 frame animation, and then aplyed some action script to the main timeline somewere along the lines of:

 
onClipEvent(enterFrame); {
math.round percentLoaded = _root.preloader.frameNum
}
 
if.framesLoaded = totalFrames gotoandplay(2);
else gotoandplay(1);

I’m not very good at actionscript so alot of thats probably wrong but hey thats why I’m asking you for help

So would this work?:h: