# Preload math

**URL:** <https://forum.kirupa.com/t/preload-math/23822>\
**Category:** Uncategorized\
**Created:** [June 22, 2003, 7:40pm UTC](https://forum.kirupa.com/t/preload-math/23822 "2003-06-22T19:40:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pspecial](https://avatars.discourse-cdn.com/v4/letter/p/3e96dc/32.png) [@pspecial](https://forum.kirupa.com/u/pspecial)\
**Post date:** [June 22, 2003, 7:40pm UTC](https://forum.kirupa.com/t/preload-math/23822/1 "2003-06-22T19:40:48Z")

</div>

Using this preloader w/percentage from the kirupa tut.

bytes\_loaded = Math.round(this.getBytesLoaded());  
bytes\_total = Math.round(this.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
this.loadBar.\_width = getPercent_100;  
this.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
this.gotoAndPlay(3);  
}

I’m having trouble calculating the getBytesTotal method to return less that the total. In other words, I’d like to start the movie before it has fully loaded. Lets say, 75% loaded then gotoAndPlay.

Anyone know how to do this??

---

<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:** [June 22, 2003, 10:05pm UTC](https://forum.kirupa.com/t/preload-math/23822/2 "2003-06-22T22:05:15Z")

</div>

just go

```auto
if (bytes_loaded >= 0.75*this.getBytesTotal()) {
//do yo thang
}

```

---

<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:** [June 23, 2003, 4:59pm UTC](https://forum.kirupa.com/t/preload-math/23822/3 "2003-06-23T16:59:17Z")

</div>

okay this works but…

the movie launches after load bar reads 50%

what I wanna do is have the bar read 100% even though the movie is only 75% loaded.

Basically, I want to fool the user that the movie is loading more quickly than it actually is. I’m counting on the remainder loading while the user reads the 1st page.

---

<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:** [June 24, 2003, 12:14am UTC](https://forum.kirupa.com/t/preload-math/23822/4 "2003-06-24T00:14:00Z")

</div>

ah. then start the bar scale at 25, so when it gets to 100, it’ll really only be 75 😉

(sneeky).
