Jay Daniliuc
Jay Daniliuc

Reputation: 3

1084: Syntax error: expecting right paren before leftbrace

I'm fairly new to action script and I was wondering if any of you guys would be able to solve my problem.

function keyDown (keyEvent:KeyboardEvent):void

{

if (keyEvent.keyCode == Keyboard.D
{
    rightPressed = true;
}
else if (keyEvent.keyCode == Keyboard.A
{
    leftPressed = true;
}
else if (keyEvent.keyCode == Keyboard.S
{
    downPressed = true;
}
else if (keyEvent.keyCode == Keyboard.W
{
    upPressed = true;
}   

}

I thought the code was fine, however whenever I run it I always get the "1084: Syntax error: expecting right parent before leftbrace" error.

Upvotes: 0

Views: 1689

Answers (1)

ThatsANo
ThatsANo

Reputation: 56

You forgot to close your parenthesis. Like this

if (keyEvent.keyCode == Keyboard.D)

You have it like this

if (keyEvent.keyCode == Keyboard.D

Upvotes: 2

Related Questions