# F5-incremental preloader, external mc's

**URL:** https://forum.kirupa.com/t/f5-incremental-preloader-external-mcs/10879
**Category:** flash
**Created:** [January 8, 2003, 8:38pm UTC](https://forum.kirupa.com/t/f5-incremental-preloader-external-mcs/10879 "2003-01-08T20:38:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![squish](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@squish](https://forum.kirupa.com/u/squish)
#### Post date: [January 8, 2003, 8:38pm UTC](https://forum.kirupa.com/t/f5-incremental-preloader-external-mcs/10879/1 "2003-01-08T20:38:06Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 9, 2003, 6:35pm UTC](https://forum.kirupa.com/t/f5-incremental-preloader-external-mcs/10879/2 "2003-01-09T18:35:20Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 9, 2003, 8:35pm UTC](https://forum.kirupa.com/t/f5-incremental-preloader-external-mcs/10879/3 "2003-01-09T20:35:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 10, 2003, 4:28pm UTC](https://forum.kirupa.com/t/f5-incremental-preloader-external-mcs/10879/4 "2003-01-10T16:28:35Z")

</div>

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();_

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 13, 2003, 4:35am UTC](https://forum.kirupa.com/t/f5-incremental-preloader-external-mcs/10879/5 "2003-01-13T04:35:37Z")

</div>

thanks for your help!

-squish
