Error 1013: The private attribute may be used only on class property definitions.

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.

Error 1013: The private attribute may be used only on class property definitions.

8 thoughts on “Error 1013: The private attribute may be used only on class property definitions.

  1. Mat says:

    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.

    Like

  2. Raakhee says:

    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

    Like

  3. schrst says:

    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…

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s