# Preload 50% of site with lostinbeta's preloader

**URL:** https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647
**Category:** Uncategorized
**Created:** [February 11, 2004, 2:22pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647 "2004-02-11T14:22:17Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![rekin\_ball](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rekin\_ball](https://forum.kirupa.com/u/rekin_ball)
#### Post date: [February 11, 2004, 2:22pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647/1 "2004-02-11T14:22:17Z")

</div>

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 = getPercent_186.9;  
this.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {this.gotoAndPlay(3) ;  
}

Thanks!  
–christina

---

<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: [February 11, 2004, 3:49pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647/2 "2004-02-11T15:49:00Z")

</div>

if (bytes\_loaded == bytes\_total/2) {this.gotoAndPlay(3) ;  
}

---

<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: [February 11, 2004, 4:24pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647/3 "2004-02-11T16:24:57Z")

</div>

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 = getPercent_186.9;  
this.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total/2) {this.gotoAndPlay(3) ;  
}

Any suggestions?  
Thanks,  
Christina

---

<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: [February 11, 2004, 5:03pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647/4 "2004-02-11T17:03:59Z")

</div>

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.

---

<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: [February 11, 2004, 7:25pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647/5 "2004-02-11T19:25:37Z")

</div>

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

---

<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: [February 11, 2004, 7:28pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647/6 "2004-02-11T19:28:16Z")

</div>

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 ![](http://aulman.com/rev.gif)

---

<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: [February 11, 2004, 7:34pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647/7 "2004-02-11T19:34:49Z")

</div>

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

---

<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: [February 11, 2004, 7:39pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647/8 "2004-02-11T19:39:01Z")

</div>

Interesting Lost…

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

thanks

Rev ![](http://aulman.com/rev.gif)

---

<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: [February 11, 2004, 7:51pm UTC](https://forum.kirupa.com/t/preload-50-of-site-with-lostinbetas-preloader/42647/9 "2004-02-11T19:51:41Z")

</div>

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