Loading bar

hi dudes and dudets, I have a quiery, im working with the tutorial 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.

[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-getPercent100;**
[/color]** this.loadText = Math.round(getPercent
100)+"%";**
** if (bytes_loaded == bytes_total) {**
** this.gotoAndPlay(3);**
}

Notice that instead of

this.loadBar._width=getPercent*100;

[left]you have

 [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]

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

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