Error 1013: The private attribute may be used only on class property definitions.
Error 1150: The protected attribute can only be used on class property definitions
Some people do not enclose their if statements with curly braces in cases like this:
// original code
if (renderAtStartup)
callLater(render);
// incorrect - notice missing opening curly brace
if (renderAtStartup)
callLater(render);
}
// correct
if (renderAtStartup) {
callLater(render);
}
I always add opening and closing braces for several reasons. One, for readability and two because tab and spaces do not match from system to system. In my case a change was made and a closing brace was placed at the end of the statement but not at the beginning. The error is generated because the opening curly brace is missing.
This causes the class to be terminated early and then this causes all the functions and properties to be located outside of the class.
I Googl’ed the error number I had in Flex Builder, found your article and solved it in less than one minute.
—-> Thanks a lot.
I have tried that….and i luckly had the curly braces open and close..i am still getting that error…cant figure out WHY :(
here is my code
private function animate(e:Event):void
{
e.target.alpha -= 0.05;
//if lightBall is no longer visible, remove it
if (e.target.alpha
Thanks a lot… adobe compiler is the worst compiler ever made, it cannot handle some basic human error.
had the same error, thanks to you i was able to solve it wirhin one minute, thanks a lot :)
strange error though, i am used to write it the “lazy” way…
Same for me, solve it in 10 seconds after seing this. Thank you.
@Erik – looks like you beat schrst by 50 seconds :)
Found the stray bracket and the problem was fixed right away. Thanks for the tip.
Flash auto-format can cause this problem too!! It generated a wrong bracket in my case !
Thanks for the post.