What kind of preloader?

Hi,

So very very close to finishing this thing. Only thing left is a preloader.

I’m reading the tuts and they all seem to accomodate for 1 movie. Seeing as my full flash site is an amalgamation of many movies, will it matter? Will the entire site load up if I only make the preloader on the first movie?

Like most sites, the ‘Work’ page has images that have bumped up the size of the swf and its considerably bigger than the first introducting movie ‘Main’.

confuzzled again.

it depends on when you are loading the extra movies. If the command to load them isn’t in the first frame of the main movie (or wherever the main movie will sit when it is preloading) then you won’t be able to preload the additional movies until the main one has loaded.

It might be that you need to preload the main movie first and then show little preloaders where and when your additional movies load, just use the preloader that preloads for one movie but have one preloader appear per movie you’re loading

if you’re loading several movies at the same time then you can make one preloader to accomodate them all but I’ll need to see your loading code to make one to suit your needs

Hope this helps :stuck_out_tongue:

*Originally posted by m_andrews808 *
If the command to load them isn’t in the first frame of the main movie (or wherever the main movie will sit when it is preloading) then you won’t be able to preload the additional movies until the main one has loaded

ok, so how do I do this. Seems to be the easiest way, then I can build a preloader for the entire site.

does that make sense?

not really sure what you mean but…

if you want to have one preloader for the whole site you’d do something like this (I’m assuming you’re using flash mx here, let me know if otherwise):

lets say this is you need to load 3 movies and you load them all in frame 1 of your main movie, this might be your code:


// load your movies
loadMovieNum("Movie1.swf", 1);
loadMovieNum("Movie2.swf", 2);
loadMovieNum("Movie3.swf", 3);

// caluculate load progress
this.onEnterFrame = function() {
          LoadSize = this.getBytesTotal() + _level1.getBytesTotal() + _level2.getBytesTotal() + _level3.getBytesTotal();
          LoadedBytes = this.getBytesLoaded() + _level1.getBytesLoaded() + _level2.getBytesLoaded() + _level3.getBytesLoaded();
          LoadProgress = (LoadedBytes / LoadTotal * 100) + "%";
}

now if you place a dynamic textfield on the stage on this frame and assign it a variable LoadProgress it will show you how much of your movie has loaded.

Does that really work? I´m not at my comp and won´t be for some days so I can´t test it myself. So if you get that to work please post a reply :slight_smile:

Yes, the code is a keeper. It works…
>Mooler< ROCK ON!!! You going to the Sanitarium show?

eek

head explodes

I’m off for beer.

but m_andrews808, now your loading the mavies at the first frame.

doesn’t

this.onEnterFrame = function() {
LoadSize = this.getBytesTotal();
LoadedBytes = this.getBytesLoaded();
LoadProgress = (LoadedBytes / LoadTotal * 100) + “%”;
}

Work?

*Originally posted by jay-em *
**Yes, the code is a keeper. It works…
>Mooler< ROCK ON!!! You going to the Sanitarium show? **

No sanitarium for me :scream: ´cause the show doesn´t reach sweden, buhuu but will be there next year when they headline theire own tour :geek:

PS. For all who gets irritated by this post I now it´s of topic but rock´n´roll is imortant :wink:

[m] that only accounts for the load progress of _level0 (the _root movie) when you tell a seperate movie to load on top of that it doesn’t effect the _root movie’s getBytesTotal so your code doesn’t account for it

Thing is, if I apply this code to my movie, what ever is on level 3 replaces the movie thats supposed to load.

http://www.charliealpha.co.uk/sites/msp/main.fla

not a problem… just change the level its loaded into:


// load your movies
loadMovieNum("Movie1.swf", 1);
loadMovieNum("Movie2.swf", 2);
loadMovieNum("Movie3.swf", 4);

// caluculate load progress
this.onEnterFrame = function() {
        LoadSize = this.getBytesTotal() + _level1.getBytesTotal() + _level2.getBytesTotal() + _level4.getBytesTotal();
        LoadedBytes = this.getBytesLoaded() + _level1.getBytesLoaded() + _level2.getBytesLoaded() + _level4.getBytesLoaded();
        LoadProgress = (LoadedBytes / LoadTotal * 100) + "%";
}

or if you want to be safe:


// load your movies
loadMovieNum("Movie1.swf", 1);
loadMovieNum("Movie2.swf", 2);
loadMovieNum("Movie3.swf", 9999);

// caluculate load progress
this.onEnterFrame = function() {
        LoadSize = this.getBytesTotal() + _level1.getBytesTotal() + _level2.getBytesTotal() + _level9999.getBytesTotal();
        LoadedBytes = this.getBytesLoaded() + _level1.getBytesLoaded() + _level2.getBytesLoaded() + _level9999.getBytesLoaded();
        LoadProgress = (LoadedBytes / LoadTotal * 100) + "%";
}