# Loading bar

**URL:** <https://forum.kirupa.com/t/loading-bar/56791>\
**Category:** Uncategorized\
**Created:** [July 7, 2004, 7:53pm UTC](https://forum.kirupa.com/t/loading-bar/56791 "2004-07-07T19:53:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeLegion](https://avatars.discourse-cdn.com/v4/letter/c/ed655f/32.png) [@CodeLegion](https://forum.kirupa.com/u/CodeLegion)\
**Post date:** [July 7, 2004, 7:53pm UTC](https://forum.kirupa.com/t/loading-bar/56791/1 "2004-07-07T19:53:15Z")

</div>

hi dudes and dudets, I have a quiery, im working with the tutorial [http://www.kirupa.com/developer/mx/percentagepreloader.htm](http://www.kirupa.com/developer/mx/percentagepreloader.htm) , and was wondering when i looked at the code, if it was possible to make the loadBar decrease in width than increase? it is frustrating as i think i know but don’t know quite how to put it in code lol. anyhow anyhelp would be appreciated.

p.s sorry if this is a simple question just it is late and im tired.

---

<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:** [July 8, 2004, 9:25am UTC](https://forum.kirupa.com/t/loading-bar/56791/2 "2004-07-08T09:25:05Z")

</div>

[left]I’m not sure if it will work (i don’t have flash here) bu try this:[/left]  
[left]1. Instead of setting the registration point to left (for the loadBar movie) set it to right.[/left]  
[left]2. your code for the first frame should be:[/left]  
[left] [/left]  
[left] **bytes\_loaded = Math.round(this.getBytesLoaded());**[/left]  
[left]\*\* bytes\_total = Math.round(this.getBytesTotal());**[/left]  
\*\* getPercent = bytes\_loaded/bytes\_total;**  
[color=red]\*\* this.loadBar.\_width = 100-getPercent_100;\*\*  
[/color]\*\* this.loadText = Math.round(getPercent_100)+"%";\*\*  
\*\* if (bytes\_loaded == bytes\_total) {\*\*  
\*\* this.gotoAndPlay(3);\*\*  
**}**

Notice that instead of

```auto
this.loadBar._width=getPercent*100;

```

[left]you have

```auto
 [color=#ff0000]this.loadBar._width = 100-getPercent*100;[/color][color=black]

```

[/color][/left]  
[left]The rest of the code stays the same.[/left]  
[left]Hope it helps :)[/left]

---

<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:** [July 8, 2004, 9:52am UTC](https://forum.kirupa.com/t/loading-bar/56791/3 "2004-07-08T09:52:59Z")

</div>

Yes this will work fine if loader bar width is 100 and If loaded bar width is more that 100 will not decrease till 0 :ub:

if ur bar width is more than 100 then you have to find out loaded value is how much % of the bar and decrease that value from loader bar total width. This is the same case for Increment too.

Regards  
Ajo.K.Jose

---

<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:** [July 8, 2004, 2:34pm UTC](https://forum.kirupa.com/t/loading-bar/56791/4 "2004-07-08T14:34:52Z")

</div>

Much appreciated dudes, it is nice to come across a furom with polite people. Thanks again. 🙂
