Is there a code

Is there a code to do this.

Make an animation that takes place when a file is loading (when it shows the preloader). And the animation should play one frame per every percent that goes up.
For example I want this Picture to fade in while the swf is loading. But I want the picture to show better by every percent that goes up while loading.
Like I have this animation in which on the first frame the picture has an alpha of 0 and on the hundreth frame it has an alpha of 100 and theres a tween between it and like i want it to be like when 1 more percent is loaded in the preloader then the animation shows frame 1 and when its done 50 percent then it shows frame 50 of the animation.
Can somebody please tell me how to do that?

Thank you

BTW the preloader is on frame 20 its not at the beggining