Problem with Percentage

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?


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