Error 1084: Syntax error: expecting rightparen before leftbrace.

Error 1084: Syntax error: expecting rightparen before leftbrace.

I'm taking this from the documentation:

The expression was unexpected at this point. If the error says "Expecting right brace before end of program," a block of code is missing a closing brace (}).

If the error says "Expecting left parenthesis before _," you may have omitted a parenthesis from a conditional expression, as shown in the following example, which is intentionally incorrect:

Actionscript:
  1. var fact:int = 1 * 2 * 3;
  2. if fact> 2 {
  3.     var bigger:Boolean = true;
  4. }

In my code, the problem was there was no closing parenthesis in the if statement.

Actionscript:
  1. // notice there is no closing ")" in the statement below
  2. if (myClass.hasOwnProperty(id) {
  3.     trace("dude is in a pop up");
  4. }

Please reply in the comments below if this helped you or not. You can also use the Error Lookup Tool to look up Flex compiler or runtime errors. more info...

4 Responses to “Error 1084: Syntax error: expecting rightparen before leftbrace.”

  1. Arnold Aprieto says:

    I had this error inside the mxml. The error "Expecting left parenthesis before _," also occur even if the you are missing a "single quote" for string. Something like this:
    Worst part is, it does not give you a specific line number to where the error occured.
    Thanks for your info.

  2. Jenyffer says:

    i can't seem to figure out why this code isnt' working....i get an error for this code, but everything seems to be fine. Can you help?

    btn_circle2.addEventListener(MouseEvent.CLICK, moveRight);

    function moveRight(e:MouseEvent):void{
    mc_box .x ++5;
    }

  3. Judah says:

    hi jenyffer,

    try:
    mc_box .x = mc_box.x + 5;

  4. Judah says:

    btw you will find a great community of flash development help here http://forums.adobe.com/community/flash/flash_general

Leave a Reply