Preloader problems

Just created a preloader using one of the tuts here. Worked great in my main timeline however, upon nesting it in a movie clip… it seems to be broken.

I put the same preloader in the 1st 2 frames of my movie clip which is located in the first frame of my main timeline.

Here’s the code I’m using:

//-----------

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}

//-----------

Why wont it work nested in a MC??

Because this will now reference the movie clip, not the main timeline.

Ahhh, Claudio… you’re my old partner in preload-school. Sorry to say I never really graduated.

Care to elaborate on “this”.?

What part of my code would YOU change? ANd where do you put it?? Main time line or movie clip timeline???

sPesh

Hey :slight_smile:
Im not understanding why you have the code on the movie clip instead of pplacing it in the main timeline.
The way you have it now, it will preload the movie clip itself, not the main movie.

Well,… I put a pre-loader on the movie clip that’s embedded in the main timeline because I thought the interpreter would just read that movie clip when the playhead reaches that frame and runs that pre-loader.

If that approach is wrong, please decribe how to do it.

Thanks
P

But you want to preload the main movie right?

Not really.

I wanted to load separate sections of the web site by having the playhead jump around to different keyframes on the main timeline. The keyframes contain the movie clips I want to load.

Maybe I have the preloader in the wrong place??

I dont know…

But if you are preloading the main movie, those “separate sections” will also be preloaded. What you can do is have these separated sections in external swf’s.

Okay, I know that I can load external files with loadMovie, etc…

But thats just avoiding the issue. THE movie clip IS on the main time line already. I just want to put a preloader between the user and that movie clip.

Okay i get that. But 1 question. Are you using or planning to use a preloader for the main movie?
If you do, that will already preload that movie clip and everything else on the main timeline.
So what you trying to do iskinda useless. :-\

OK, good point But, thats also the point of my question. I DON’t want to preload the entire movie… just the individual movie clips as they are needed. This is a site for a photographer/writer so… every section is gonna have many MBs of content, I dont want to preload the entire movie… just the ‘sections’ as they are requested.

Well, first of all you need to preload something. So if you dont want to preload everything, best thing is have only the essential on the main movie. Then load the rest from external swfs, as you need them.