# Preloader

**URL:** <https://forum.kirupa.com/t/preloader/5897>\
**Category:** Uncategorized\
**Created:** [September 25, 2002, 11:34am UTC](https://forum.kirupa.com/t/preloader/5897 "2002-09-25T11:34:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![deev](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@deev](https://forum.kirupa.com/u/deev)\
**Post date:** [September 25, 2002, 11:34am UTC](https://forum.kirupa.com/t/preloader/5897/1 "2002-09-25T11:34:54Z")

</div>

How can i make a preloader that says how many percent and how many bytes he has downloaded from the whole ‘movie’  
vb…

79 percent  
20KB/2000kB?

POlease help me

THNX:-\

---

<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:** [September 25, 2002, 1:16pm UTC](https://forum.kirupa.com/t/preloader/5897/2 "2002-09-25T13:16:05Z")

</div>

Define 2 variables

\_root.loaded=\_root.getBytesLoaded()  
\_root.total=\_root.getBytesTotal()

then

\_root.percentLoaded=(loaded/total)\*100

Obviously, that will only perform the calculation once so you’ll need to make a loop use the following code in two subsequent frames of your preLoader

(place on first frame)  
\_root.loaded=\_root.getBytesLoaded()  
\_root.total=\_root.getBytesTotal()  
\_root.percentLoaded=(\_root.loaded/\_root.total)\*100

(place on second frame)  
if (\_root.percentLoaded\<100) {  
gotoAndPlay(\_currentFrame-1);  
} else {  
gotoAndPlay(“start”);  
}

where start is the first frame of your movie

The \_root means that this snippet of code will work inside a MC that isn’t on the main timeline - if you’re evaluating percentLoaded on the main timeline, then you can dispense with the \_root.

To display the variable percentLoaded - define a dynamic text field with the varible name \_root.percentLoaded

There’s probably a tutorial that explains this bettter with examples - some one will post the link, I’m sure.

---

<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:** [September 26, 2002, 8:02am UTC](https://forum.kirupa.com/t/preloader/5897/3 "2002-09-26T08:02:40Z")

</div>

Hey Deev,  
Take a look at this I hope it helps, its a working preloader that hopefully covers what you was asking for:bandit:

---

<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:** [September 26, 2002, 8:04am UTC](https://forum.kirupa.com/t/preloader/5897/4 "2002-09-26T08:04:15Z")

</div>

Whoops, here it is:bandit:

---

<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:** [September 26, 2002, 1:09pm UTC](https://forum.kirupa.com/t/preloader/5897/5 "2002-09-26T13:09:52Z")

</div>

i hope no 1’s asked it, but for the preloader, how do u get the like percentage baR?

" 90%  
||||||||||||||||||||||||||||||||||| |" -kinda like thiss…

---

<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:** [September 26, 2002, 1:52pm UTC](https://forum.kirupa.com/t/preloader/5897/6 "2002-09-26T13:52:23Z")

</div>

Hi J0ng,  
Is this the sort of thing you was after:bandit:

---

<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:** [September 26, 2002, 3:12pm UTC](https://forum.kirupa.com/t/preloader/5897/7 "2002-09-26T15:12:51Z")

</div>

yep! thx, but hahaa… its been like 15 mins n i’m still figurin it ouT ☹ 10x still!

---

<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:** [September 27, 2002, 1:44pm UTC](https://forum.kirupa.com/t/preloader/5897/8 "2002-09-27T13:44:00Z")

</div>

Hey J0ng,  
I’m not sure how far you got with the last progress bar I sent so here is a simplified version, I think you’ll find this one much easier to understand:bandit:

---

<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:** [September 28, 2002, 4:50am UTC](https://forum.kirupa.com/t/preloader/5897/9 "2002-09-28T04:50:55Z")

</div>

thX duDe! 😛 such a kinD souL
