Reputation: 57
package
{
import flash.events.*
import flash.ui.*
public class tank () //1084: Syntax error: expecting leftbrace before leftparen.
{
//other stuff
}
}
This is a recurring bugger of an error that i can't figure out and it seems to be the one version of error 1084 I can't find by googling...
I tried putting the left brace after that line before the parenthesis and before the whole line, other errors...
Upvotes: 0
Views: 5966
Reputation: 39456
A class definition does not utilise parenthesis. You may be confusing the class definition with the constructor, which does use parenthesis and is nested within the class.
Basically, just remove the ()
at the end of here:
public class tank
And then your constructor would be within that using the parenthesis like so:
public class tank
{
// This is a constructor. It is a public method with the same name as
// the class it is defined within, and is called when an instance of
// this class is created.
public function tank()
{
//
}
}
Upvotes: 2
Reputation:
Your syntax is incorrect. If you're trying to make a class, you need to get rid of the left and right parenthesis (like the error is telling you, you're giving it the wrong input and its expecting a left brace ({
)). So, try the following:
package
{
import flash.events.*; // Put a semi-colon after imports
import flash.ui.*; // Here too
//public class tank () // 1084: Syntax error: expecting leftbrace before leftparen.
public class tank // This should not error on you.
{
//other stuff
}
}
Hope that helps!
Upvotes: 2