跪求指点:语法错误1084
package
{
public class Greeter
{
public static var validNames:Array={"S","D","F"};
public function Greeter()
{
}
public static function sayHello(userName:String=""):String
{
var greating:String;
if (userName =="")
{
greating="hello,please enter your name,and then press the enter key";
}
else if(validName(userName))
{
greating="hello"+userName+",";
}
else
{
greating="sorry,"+userName+"you are not on the list";
}
return greating;
}
public static function validName(inputName:String=""):Boolean
{
if(validNames.indexOf(inputName)>-1)
{
return true;
}
else
{
return false;
}
}
}
}
出现两个错误:
1084: 语法错误: colon 应在 comma 之前。 Greeter.as /Hello/src 第 8 行 Flex 问题
1084: 语法错误: identifier 应在 rightbrace 之前。 Greeter.as /Hello/src 第 8 行 Flex 问题
大虾指点指点......拜托了........