PDA

View Full Version : #$&^!@#)$^@#$^ syntax



shuga
September 13th, 2002, 11:14 AM
k ... its a new day at work and i still can't figure this **** thing out. guess this is why i'm not a good coder ... i have no patience for syntax.



onClipEvent (enterFrame) {
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
gotoAndStop(2);
} else {
_root.stop;
}
percentLoaded=Math.round(((_root.getBytesLoaded())/(_root.getBytesTotal())) * 100);
loadedFile = "File is" + percentLoaded + "% loaded";


here is the errors it's returning


Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Statement block must be terminated by '}'
onClipEvent (enterFrame) {

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 8: Syntax error.
loadedFile = "File is" + percentLoaded + "% loaded";

andr.in
September 13th, 2002, 11:36 AM
add this: }
at the end of the code
this may remove both of the errors but I'm not sure...

shuga
September 13th, 2002, 11:38 AM
omfgosh
so weird
i was like why do i need a } at the end and why would that take away both errors ... but it worked

thanks so much
i really appreciate it

eyezberg
September 13th, 2002, 04:22 PM
{Hey shuga pie,

actionscript coding basics:

1.each command ends with a ";"
2.each ( you open needs a ) to close and
3.same for each { you need an }
4.and there's no ";" after the closing } of an if or else check..

READ the error messages, the solution is in there! ;)

"Statement block must be terminated by '}'"

done, so }

Bezzer
September 14th, 2002, 06:33 AM
well it depends if you do


onEnterFrame = function(){
//do stuff
};


Thats suposed to be the corect syntax for things like that...but it will work either way :) hehe