F5-incremental preloader, external mc's

i have 2 questions:

–1--
i have a 11 frame preloader animation that i want to advance one frame per 10% bytes loaded. (ie. if 10% loaded go to frame 2, if 20% loaded go to frame 3, etc.)
how do i split the bytes_loaded into 10 chunks?

–2--
is it possible to have a preloader in an external m/c that plays the aforementioned animation in the main movie?
what i want to do is have a preloader animation playing on level 1 while the external mc is being loaded into level 0 behind a mask. is this possible?? or will i have to create the mask for every external mc ?
sounds confusing i know.

thanks for any help,
squish.

  1. Use getBytesLoaded and getBytesTotal to calculate the percentage. Example (steping by 10%):
    percentLoaded=Math.floor(_root.getBytesLoaded()/_root.getBytesTotal()*10);
    then use the value of percentLoaded to jump to each frame in the status bar

  2. I normally place my preloader in a separate scene, or in frame 1 by itself. I haven’t tried loading things in at different levels.

thank you for the response.
it works except for a small glitch when loading the first 10% of the movie.
it seems to play through part of the preloader then it resets and its fine. do you have any idea why this happens?

is there a problem with the integer 0 and flash not having a frame 0?

i added a few frames at the end of the preloader that i would like to play through before moving onto scene two. i can’t get it to play through and move on to scene 2.
any ideas would be helpful

thanks again,
-squish

In the preloader, change the action in frame 1 from:
bar.stop();
to
stop();

One way to play your additional animation is to make the following changes to the preloader.
Frame 1 actions:
*percentLoaded = Math.floor(_root.getBytesLoaded()/_root.getBytesTotal()10);
bar.gotoAndStop(percentLoaded);

Frame 2 actions:
if (percentLoaded <10) gotoAndPlay (1);
else {
stop();
bar.play();
}

Place the following action in the bar movie clip at the last animation frame:
_root.play();

thanks for your help!

-squish