# Pre-loader Pros

**URL:** https://forum.kirupa.com/t/pre-loader-pros/29121
**Category:** flash
**Created:** [August 22, 2003, 3:04pm UTC](https://forum.kirupa.com/t/pre-loader-pros/29121 "2003-08-22T15:04:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Deland02](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@Deland02](https://forum.kirupa.com/u/Deland02)
#### Post date: [August 22, 2003, 3:04pm UTC](https://forum.kirupa.com/t/pre-loader-pros/29121/1 "2003-08-22T15:04:38Z")

</div>

The situation is this:

Im trying to make a pre-loader that displays the load amount in text as a % and has a loading bar that will only load when the movie loads. When the movie is fully loaded the loading bar fill be full and it will display 100%, when the movie is half full it will be 50% and the bar will only be half way across.

If I wanted to make the loading bar a specific width how would I do it??

At the moment the bar only seams to want to be 100 wide.

The script im using so far is:

\_width\_root.loadBar=500  
bytes\_loaded = Math.round(\_root.getBytesLoaded());  
bytes\_total = Math.round(\_root.getBytesTotal());  
getPercent = bytes\_loaded/bytes\_total;  
\_root.loadBar.\_width = getPercent_100;  
\_root.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
\_root.gotoAndStop(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: [August 22, 2003, 3:11pm UTC](https://forum.kirupa.com/t/pre-loader-pros/29121/2 "2003-08-22T15:11:16Z")

</div>

By any chance you tried this one?  
[http://www.kirupa.com/developer/mx/percentagepreloader.htm](http://www.kirupa.com/developer/mx/percentagepreloader.htm)  
:sigh:

---

<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: [August 22, 2003, 3:28pm UTC](https://forum.kirupa.com/t/pre-loader-pros/29121/3 "2003-08-22T15:28:21Z")

</div>

Yeh, thats where I got the script from, had read through the tutorial and then had a goo my self. If you go to:

[www.serioussounds.net/0/SS](http://www.serioussounds.net/0/SS) Pre-loader01.swf

you wull see what I want as my pre-loader and how it works. I have put a white shape acting as a mask over the logo. as the movie loads the white shape gets smaller, un-covering the logo and gives the effect it is filling up with colour.

If possable I want the white shape (mask) to have fully un-covered the logo at 100%

---

<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: [August 23, 2003, 2:33pm UTC](https://forum.kirupa.com/t/pre-loader-pros/29121/4 "2003-08-23T14:33:59Z")

</div>

Try making clip with a text box and a rectangle shape that you tween over 100 frames. You can frame the full rectangle shape with a hairline box in another layer that is not tweened to give the illusion that the box is filling up.

something in your pre-loader code to make it move like

percentLoaded = Math.floor(loaded/total\*100);  
\_root.bar\_mc.loaderText.text = percentLoaded;  
\_root.bar\_mc.gotoAndStop(percentLoaded);

since the bar tweens from no length at frame 1 to full length at frame 100, the load bar will reflect how much of the movie is loaded.

That’s the rough idea anyway.

---

<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: [August 26, 2003, 7:10am UTC](https://forum.kirupa.com/t/pre-loader-pros/29121/5 "2003-08-26T07:10:55Z")

</div>

Thanks, I’ll have a go.
