# Preloader countdown

**URL:** https://forum.kirupa.com/t/preloader-countdown/118568
**Category:** Uncategorized
**Created:** [August 6, 2004, 7:22pm UTC](https://forum.kirupa.com/t/preloader-countdown/118568 "2004-08-06T19:22:25Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dude9er](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dude9er](https://forum.kirupa.com/u/dude9er)
#### Post date: [August 6, 2004, 7:22pm UTC](https://forum.kirupa.com/t/preloader-countdown/118568/1 "2004-08-06T19:22:25Z")

</div>

I’ve been searching the threads and haven’t found any info on preloaders that countdown from 100 to 0. Is there any way of doiong this? I’m sure it has to do with setting the math properties in the code, but don’t have a clue about how to do this.

Anyone have any links or leads for me?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![bwh2](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bwh2](https://forum.kirupa.com/u/bwh2)
#### Post date: [August 6, 2004, 10:48pm UTC](https://forum.kirupa.com/t/preloader-countdown/118568/2 "2004-08-06T22:48:09Z")

</div>

say you’re using this tutorial: [http://www.kirupa.com/developer/mx/percentagepreloader.htm](http://www.kirupa.com/developer/mx/percentagepreloader.htm)

try changing this:[AS]this.loadText = Math.round(getPercent_100)+"%";[/AS]to:[AS]this.loadText = 100-Math.round(getPercent_100)+"%";[/AS]

i think that should work.

---

<div class="post-metadata">

### Author: ![dude9er](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dude9er](https://forum.kirupa.com/u/dude9er)
#### Post date: [August 8, 2004, 4:23pm UTC](https://forum.kirupa.com/t/preloader-countdown/118568/3 "2004-08-08T16:23:22Z")

</div>

thanks bwh I’ll give it a try and see how it goes.

---

<div class="post-metadata">

### Author: ![dude9er](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dude9er](https://forum.kirupa.com/u/dude9er)
#### Post date: [August 14, 2004, 5:40am UTC](https://forum.kirupa.com/t/preloader-countdown/118568/4 "2004-08-14T05:40:42Z")

</div>

> [@bwh2](#):
>
> say you’re using this tutorial: [kirupa.com - Percentage Preloader with Load Bar](http://www.kirupa.com/developer/mx/percentagepreloader.htm)
> 
> try changing this:[AS]this.loadText = Math.round(getPercent_100)+“%”;[/AS]to:[AS]this.loadText = 100-Math.round(getPercent_100)+“%”;[/AS]
> 
> i think that should work.

hey bwh, here’s my code, can’t figure out how to make it count backwards with this code. any ideas at all?

```auto
onClipEvent (enterFrame) {
	loading = _parent.getBytesLoaded();
	total = _parent.getBytesTotal();
	percent -= (percent-((loading/total)*100))*.25;
	per = int(percent);
	percentage = per+"%";
	loadBar._width = per;
	if (percent>99) {
		_parent.gotoAndPlay(16);
	}
}

```

thanks man!!

---

<div class="post-metadata">

### Author: ![bwh2](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bwh2](https://forum.kirupa.com/u/bwh2)
#### Post date: [August 14, 2004, 6:16am UTC](https://forum.kirupa.com/t/preloader-countdown/118568/5 "2004-08-14T06:16:28Z")

</div>

try this:[AS]onClipEvent (enterFrame) {  
loading = \_parent.getBytesLoaded();  
total = \_parent.getBytesTotal();  
percent -= (percent-((loading/total)_100))_.25;  
per = int(percent);  
percentage = 100-per+"%"; // here’s the edit  
loadBar.\_width = per; // if you want the bar to go in reverse, make this loadBar.\_width = 100-per;  
if (percent\>99) {  
\_parent.gotoAndPlay(16);  
}  
}[/AS]

---

<div class="post-metadata">

### Author: ![NovemberRain](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@NovemberRain](https://forum.kirupa.com/u/NovemberRain)
#### Post date: [August 14, 2004, 7:58am UTC](https://forum.kirupa.com/t/preloader-countdown/118568/6 "2004-08-14T07:58:17Z")

</div>

:p: Here is another example with a progress bar…pls check the attachment

```auto

totalbytes = _root.getBytesTotal();
loadedbyes = _root.getBytesLoaded();
x = 100 - int ((loadedbyes/totalbytes)*100);//Get the 100 - value
/:bar.gotoAndStop(x); //This bat.framenumber stop the current frame

ifFrameLoaded ("Scene 1", 1){
 gotoAndStop("Scene 1", 1);
}

```
