fario
asked on
Function to find is a number is Odd or Even in AS3
i'm trying to create this function but i have this error:
1071: Syntax error: expected a definition keyword (such as function) after attribute returns, not false.
1084: Syntax error: expecting rightbrace before semicolon.
Thank You
1071: Syntax error: expected a definition keyword (such as function) after attribute returns, not false.
1084: Syntax error: expecting rightbrace before semicolon.
Thank You
function isOdd(number:int):Boolean;
{
//check if the number is odd or even
if (number % 2 == 0)
{
returns false;
}
else
{
returns true;
}
}
remove the semicolon after Boolean.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oop. forgot the variable types - but you get the picture :)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.