# Preloader error - what could this be?

**URL:** <https://forum.kirupa.com/t/preloader-error-what-could-this-be/184238>\
**Category:** Uncategorized\
**Created:** [April 3, 2006, 5:14pm UTC](https://forum.kirupa.com/t/preloader-error-what-could-this-be/184238 "2006-04-03T17:14:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottM](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@ScottM](https://forum.kirupa.com/u/ScottM)\
**Post date:** [April 3, 2006, 5:14pm UTC](https://forum.kirupa.com/t/preloader-error-what-could-this-be/184238/1 "2006-04-03T17:14:27Z")

</div>

I’ve got a preloader with the script below but I keep getting a Sytax error with it. It seems to work fine. Don’t really know because I don’t have a lot of information on the site just yet. Here is the error…

**Error** Symbol=Bar, layer=fill, frame=1:Line 10: Syntax error.  
\_parent.txt = percent add “%”;

Here is the code I’m using.

```auto
onClipEvent (load) {
	_root.stop();
}
onClipEvent (enterFrame) {
	var totalk = _root.getBytesTotal()/1024;
	var loadedk = _root.getBytesLoaded()/1024;
	var percent = Math.round((loadedk/totalk)*100);

	if (percent<100) {
		_parent.txt = percent add "%";
		_xscale = percent;
	} else {
		_root.play();
	}
}

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [April 3, 2006, 5:22pm UTC](https://forum.kirupa.com/t/preloader-error-what-could-this-be/184238/2 "2006-04-03T17:22:55Z")

</div>

using \_parent just tells flash to go out one level from where the code is written and look for the thing after \_parent, which in your case is “txt”. Do you have a movieclip called txt? Also, I’m not sure what “percent add” means?

---

<div class="post-metadata">

**Author:** ![ScottM](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@ScottM](https://forum.kirupa.com/u/ScottM)\
**Post date:** [April 3, 2006, 6:57pm UTC](https://forum.kirupa.com/t/preloader-error-what-could-this-be/184238/3 "2006-04-03T18:57:36Z")

</div>

Thanks lunatic,  
There is a dynamic text box named “txt”. I just found this code and thought I would try it out. If I need to use something else I will. Just wondering why it wasn’t working.

Trying to learn AS. But can’t figure some things out.

Thanks again!

---

<div class="post-metadata">

**Author:** ![lolomedia](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lolomedia](https://forum.kirupa.com/u/lolomedia)\
**Post date:** [April 3, 2006, 8:08pm UTC](https://forum.kirupa.com/t/preloader-error-what-could-this-be/184238/4 "2006-04-03T20:08:20Z")

</div>

Hello Scott,

follow this tutorial… its very simple.

but don’t just follow it… also read what it means each line… then you will be able to modify it as you wish.

[http://www.kirupa.com/developer/mx/percentagepreloader.htm](http://www.kirupa.com/developer/mx/percentagepreloader.htm)

it worked great for me!

cheers!

:nerd:

---

<div class="post-metadata">

**Author:** ![ScottM](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@ScottM](https://forum.kirupa.com/u/ScottM)\
**Post date:** [April 3, 2006, 8:20pm UTC](https://forum.kirupa.com/t/preloader-error-what-could-this-be/184238/5 "2006-04-03T20:20:31Z")

</div>

hey thanks lolomedia. I’ll check it out.
