Link to home
Start Free TrialLog in
Avatar of fario
farioFlag for Italy

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

function isOdd(number:int):Boolean; 
{
	//check if the number is odd or even
	if (number % 2 == 0)
	{
		returns false;
	}
	else
	{
		returns true;
	}
}

Open in new window

Avatar of alien109
alien109
Flag of United States of America image

remove the semicolon after Boolean.
ASKER CERTIFIED SOLUTION
Avatar of alien109
alien109
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oop. forgot the variable types - but you get the picture :)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial