Preloader countdown

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.

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

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

i think that should work.

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

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

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!!

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]

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


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);
}