Prloaders in MC's

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

Are you using Flash 5 or MX ?

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

bytes_loaded=_root.getBytesLoaded()
bytes_total=_root.getBytesTotal()
if(bytes_loaded>=bytes_total){
      _root.play()
}

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) :slight_smile:

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

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.

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) :slight_smile:

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

Is this the most effective way?

Thanks