PDA

View Full Version : [AS3] Syntax Error!


chico83
03-17-2009, 07:04 PM
I'm having a slight problem with this piece of code. If anyone could help me out that would great. cheers! ;)

1. 1084: Syntax error: expecting rightbrace before leftbrace.
2. 1083: Syntax error: else is unexpected.

Power5.addEventListener(MouseEvent.CLICK, P5);
function P5(Event:MouseEvent):void{
If (DirNotNorth = false) {
Golf_Ball.y -=85
Golf_Ball.x -=(NewDir)
} else {
Golf_Ball.y +=85
Golf_Ball.x -=(NewDir)
}
}

CyanBlue
03-17-2009, 07:18 PM
Howdy and Welcome... :)

ActionScript is case sensitive language... 'If' should be 'if'...

chico83
03-17-2009, 07:24 PM
Oh yea, I was sitting there for hours trying to figure it out :rolleyes:.

Thanks! :D

CyanBlue
03-17-2009, 07:26 PM
Glad to help... ;)

m4r7in
03-18-2009, 09:58 AM
Also you have to compare with "==" not "="

kkbbcute
03-18-2009, 10:41 AM
Also you have to compare with "==" not "="

Darn, why didn't I spot it. :p The simple things always evade your notice.

CyanBlue
03-18-2009, 03:22 PM
Good catch, m4r7in... ;)