# PreLoader - ActionScript

**URL:** <https://forum.kirupa.com/t/preloader-actionscript/122424>\
**Category:** Uncategorized\
**Created:** [September 13, 2004, 5:35pm UTC](https://forum.kirupa.com/t/preloader-actionscript/122424 "2004-09-13T17:35:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChaoticGood](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@ChaoticGood](https://forum.kirupa.com/u/ChaoticGood)\
**Post date:** [September 13, 2004, 5:35pm UTC](https://forum.kirupa.com/t/preloader-actionscript/122424/1 "2004-09-13T17:35:53Z")

</div>

Greetings.

I know there are many ways to program a preloaded. I just happened to choose the most difficult for a person just learning actionscript. I used the tutorial from [netmag.co.uk](http://netmag.co.uk) and am receiving 4 errors on output - unexpected “if” encountered, unexpected “else” encountered, Line 14: ‘)’ or ‘,’ expected and ine 15: Syntax error.

Here is the script in question -

//find out how much data has loaded  
count=int(\_root.getBytesLoaded()/1024)+“KB”;  
total=int(\_root.getBytesTotal()/1024)+“KB”;  
percentage=int(\_root.getBytesLoaded()/\_root.getBytesTotal()\*100+"%",  
status=“Loading…”,  
//set the x scale of the loadbar  
loadbar\_size=int(\_root.getBytesLoaded()/\_root.getBytesTotal()\*100),  
setProperty(“loadbar”,\_xscale,loadbar\_size),  
//check if all data is loaded  
if(\_root.getBytesLoaded()=\_root.getBytesTotal()) {gotoAndPlay(“darksite”),  
else {  
percentage=“100%”,  
status = “Loaded”,  
setProperty("loadbar, \_xscale, “100”),  
gotoAndPlay (“darksite”,1);  
}  
Any help is much appreciated.

Thanks,  
ChaoticGood.
