Movieclip preloader?

I read something about this in a tread, but didn’t get any further.
Is it possible to create a movieclip, lets say it contains 10 frames of some animation. And put it on the main timeline and add some code to it that makes the movieclip-animation work as a preloader? So the animation starts on frame 1 and plays frame by frame until the stuff is loaded. (so it stops on frame 10)

Hope you understand this one:)
Cheers!

yes its very possible…

assuiming you have a clip with 10 frames to show the progress use the standard preloader code to set a variable “barlevel” inside an onEnterFrame


this.onEnterFrame = function() {
    //
    barlevel = Math.floor(movieClip.getBytesLoaded()/movieClip.getBytesTotal())*100;
    //
    if (barlevel>0) {
        clipToAnimate.gotoAndStop(Math.round(barlevel/10));
    } else {
        clipToAnimate.gotoAndStop(1);
    }
};

Umm okey! thank you:)
but more detailed, what do I do?^^

In frame 1 (main timeline) I have the preloader.
In frame 2 (main) I have my content that is going to be loaded.

The preloader is a simple movieclip of 10 frames.

The code that you wrote, where shall it put it and what do I need to give an instance name etc. if thats necessary?

:smiley:

This might help

okey! thanks rawnewdlz;)

yes:D that was it;)