# Prloaders in MC's

**URL:** <https://forum.kirupa.com/t/prloaders-in-mcs/33584>\
**Category:** Uncategorized\
**Created:** [October 21, 2003, 10:10am UTC](https://forum.kirupa.com/t/prloaders-in-mcs/33584 "2003-10-21T10:10:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kev](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@kev](https://forum.kirupa.com/u/kev)\
**Post date:** [October 21, 2003, 10:10am UTC](https://forum.kirupa.com/t/prloaders-in-mcs/33584/1 "2003-10-21T10:10:21Z")

</div>

I just wondered if it is possible to have a preloader for each MC within a movie?

I have one simple preloader for the movie:

[AS]  
total\_bytes = \_root.getBytesTotal();  
loaded\_bytes = \_root.getBytesLoaded();  
percent\_done = int((loaded\_bytes/total\_bytes)\*100);  
ifFrameLoaded (“Scene 1”, 30) {  
play ();  
}

[/AS]

Now my movie is 60 frames long, the above will only preload the first 30 frames right? So If I have a button that goes to frame 35 on the main timeline and on frame 35 is MC1, can I have a preloder within this MC1 which is 55 frames long? I am just trying to get away from loading seperate swf’s into levels!

maybe something like this:

[AS]  
total\_bytes = \_root.MC1.getBytesTotal();  
loaded\_bytes = \_root.MC1.getBytesLoaded();  
percent\_done = int((loaded\_bytes/total\_bytes)\*100);  
ifFrameLoaded ("\_root.MC1", 55) {  
tellTarget ("\_root.MC1") {  
play ();  
}  
}

[/AS]

I tried the above and it just showed 100%

Any ideas where I went wrong

Thanks

---

<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:** [October 21, 2003, 5:25pm UTC](https://forum.kirupa.com/t/prloaders-in-mcs/33584/2 "2003-10-21T17:25:20Z")

</div>

Are you using Flash 5 or MX ?

---

<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:** [October 21, 2003, 5:53pm UTC](https://forum.kirupa.com/t/prloaders-in-mcs/33584/3 "2003-10-21T17:53:32Z")

</div>

Also, it seems to me you are defining variables that aren’t being used. The ifFrameLoaded () synatx is a preloader in itself. The bytes\_loaded and all are for doing stuff like

```auto
bytes_loaded=_root.getBytesLoaded()
bytes_total=_root.getBytesTotal()
if(bytes_loaded>=bytes_total){
      _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:** [October 21, 2003, 6:50pm UTC](https://forum.kirupa.com/t/prloaders-in-mcs/33584/4 "2003-10-21T18:50:33Z")

</div>

Hi, I am using Flash 5! So I can’t use the above for an MC then? is there a different syntax for that?

Basically I want eliminate the need to loadmovie’s in for each of my sections.

I Want to first load in the site and not the 5 specific MC’s. (I have read about this somewhere before and it is possible, I just can’t remember or find it) 🙂

So when any of the 5 MC’s is called I want to place a preloader in it, as if I was loading another movie to another level!

thanks

---

<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:** [October 21, 2003, 7:31pm UTC](https://forum.kirupa.com/t/prloaders-in-mcs/33584/5 "2003-10-21T19:31:41Z")

</div>

Yeah, you’d need to use other syntax. Unfortunately, I’ve never used Flash 5 and I don’t know it’s syntax, so someone else’ll have to help you with this.

---

<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:** [October 21, 2003, 7:47pm UTC](https://forum.kirupa.com/t/prloaders-in-mcs/33584/6 "2003-10-21T19:47:08Z")

</div>

Thanks anyway! Actually I have been thinking about this and I will use the load movie command after all. Just a quick question is this the best way to creat a flash site?:

Have a blank movie (level0) with one frame which loads in the main movie into level50. (50 levels should be enough) 🙂

Then all the other movies can be loaded in under the main movie.

Is this the most effective way?

Thanks
