# Problem with Percentage

**URL:** <https://forum.kirupa.com/t/problem-with-percentage/108397>\
**Category:** Uncategorized\
**Created:** [April 24, 2004, 8:53pm UTC](https://forum.kirupa.com/t/problem-with-percentage/108397 "2004-04-24T20:53:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Exedus](https://avatars.discourse-cdn.com/v4/letter/e/b19c9b/32.png) [@Exedus](https://forum.kirupa.com/u/Exedus)\
**Post date:** [April 24, 2004, 8:53pm UTC](https://forum.kirupa.com/t/problem-with-percentage/108397/1 "2004-04-24T20:53:35Z")

</div>

OK, I’ve used this script before so I can’t figure out why it’s not working this time. The preloader movieclip runs fine. It’s the percentage box that shows up as “undefined %”

I have \_root.percentage in the variable box for the dynamic textbox.

Any ideas?

```auto

if (getBytesLoaded()!=getBytesTotal()) {
	_root.percentage=math.round((getBytesLoaded()/getBytesTotal()*100))+"%";
	_root.gotoAndPlay("preload");
	}
else if	(getBytesLoaded()==getBytesTotal()) { 
	_root.preloader.gotoAndPlay("end");
	_root.gotoAndStop("done");
	
}

```
