Preload 50% of site with lostinbeta's preloader

Hello,
I have been searching and I know that it is possible to only load a portion of a site with a preloader. I was wondering if anyone knows how I can do this with lostinbeta’s preloader from the tut on this site?

The reason I want to do this is because the site is for a photographer and the portfolios take awhile to load, if I load half the portfolio by the time you get to the second half it will be loaded anyway, so why have people wait for the entire portfolio to load.

By the way, I wanted to thank lostinbeta for a great tut, the preloader works great and the tut was easy to understand even for a newbie such as myself!
Below is the code from the tut…

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

Thanks!
–christina

if (bytes_loaded == bytes_total/2) {this.gotoAndPlay(3) ;
}

Hi, thanks for responding!
I tried to add the code, but I didn’t get it to work. The progress bar moves forward then stop when it finishes it does not go to the third frame. Also the laod time doesn’t see any faster.
Here is what the code looks like now…

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

Any suggestions?
Thanks,
Christina

Instead of == use >= since theres a chance that bytes_loaded will never EXACTLY equal bytes_total/2.

However, I don’t see why you would want to do this. It kind of defeats the purpose of a preloader since you need to preload all of the content before playing your movie otherwise a lag typically occurs.

Thanks,
That worked great. The only problem is that the bar only fills half way up, then it plays the third frame. I tried changing the code to make it fill up completely, but I can’t figure it out. This is possible right?

Oh and I am only loading half the movie because the viewer will be progressing the movie forward with a “next image” button. I figured that if half the movie is loaded, by the time they progress up to the last 50% the rest of the movie should be loaded.

Is this correct?

Othewise the loading time is just too long, the images are high quality and pretty big. They are for a still-life photographer.

Thanks again for all your help!
christina

christina:

correct use of a preloader, however, you will cause confusion to some of the users… They will think that the movie is only half loaded when it starts.

that is the only drawback to your solution that I can see.

Rev

[AS]this.loadBar._width = getPercent186.9;[/AS] should be changed to [AS]this.loadBar._width = (getPercent2)*186.9;[/AS] Since you are halving the loading percent you need to double the amount the bar grows by.

Interesting Lost…

I just usually avoid the whole preloader issue, but this will help a bunch when I have to use one…

thanks

Rev

Thank you everyone, it is working! Yeah!
This forum has some of the most helpful people ever on it.
Thanks again,
christina