# Preloader question

**URL:** <https://forum.kirupa.com/t/preloader-question/205053>\
**Category:** Uncategorized\
**Created:** [October 25, 2006, 6:00pm UTC](https://forum.kirupa.com/t/preloader-question/205053 "2006-10-25T18:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![derekblais](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@derekblais](https://forum.kirupa.com/u/derekblais)\
**Post date:** [October 25, 2006, 6:00pm UTC](https://forum.kirupa.com/t/preloader-question/205053/1 "2006-10-25T18:00:00Z")

</div>

Hey!

I am creating a preloader, but I want the % to load backwards…

Right now, it is loading from 0% \> 100%. I want it to load from 100% \> 0%

My copy says “Different is \_\_\_\_ away”. The “\_\_\_” part will be the number and % sign, going from 100, all the way down to 0. So,

“Different is 100% away” then “Different is 65% away” (as it is loading)… all the way to “Different is 0% away”

My preloader code is

> theTargetLevel = \_root.target\_mc;  
> loadingDisplayText = textDisplay;  
> if (theTargetLevel.getBytesTotal() != undefined) {  
> Loaded = Math.round(theTargetLevel.getBytesLoaded()/1024);  
> Total = Math.round(theTargetLevel.getBytesTotal()/1024);  
> percent = Math.round((Loaded/Total)\*100);  
> //percentTotal = Math.round((((100)/\_root.TotalL)\*Loaded)+\_root.currentTotalBarScale)  
> if (isNaN(percent)==false && percent != undefined && percent != “”) {  
> if (percent\>=percentRequired) {  
> \_parent.currentTotalBarScale = totalBar\_mc.\_yscale;  
> \_parent.play();  
> } else {  
> \_root.loading\_mc.\_alpha = 100;  
> loadingBar\_mc.\_yscale = percent;  
> percentDisplay = percent+“%”;  
> if (percentTotal\>=100){  
> percentTotal = 100;  
> }  
> totalBar\_mc.\_yscale = percentTotal;  
> totalDisplay = percentTotal+“%”;  
> }  
> } else {  
> //loadingDisplayText = “ **ERROR** var percent = NaN or undefined or ‘’”;  
> }  
> gotoAndPlay(“loop”);  
> }

---

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [October 25, 2006, 6:58pm UTC](https://forum.kirupa.com/t/preloader-question/205053/2 "2006-10-25T18:58:49Z")

</div>

totalBar\_mc.\_yscale = percentTotal;  
var diff = 100 - percentTotal;  
totalDisplay = diff+"%";

---

<div class="post-metadata">

**Author:** ![derekblais](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@derekblais](https://forum.kirupa.com/u/derekblais)\
**Post date:** [October 25, 2006, 9:00pm UTC](https://forum.kirupa.com/t/preloader-question/205053/3 "2006-10-25T21:00:06Z")

</div>

[QUOTE=creatify;1985359]totalBar\_mc.\_yscale = percentTotal;  
var diff = 100 - percentTotal;  
totalDisplay = diff+"%";[/QUOTE]

Awesome! I’ll try that out. Thanks so much. 🙂
