我对动作脚本3很新,遇到了我正在建立的功能的问题。每次我测试它是否给我一个真实的陈述和if参数它声称它是假的(frgo3按钮)。这是代码:
var check:Boolean = false;
var input1:String;
var answer:String = "New_York_Harbor";
fr1check.addEventListener (MouseEvent.CLICK, checkfr);
frgo3.addEventListener (MouseEvent.CLICK, Moveonfr);
frno3.addEventListener (MouseEvent.CLICK, Movenofr);
function checkfr(event:MouseEvent):void{
input1= frin.text;
check = true;
if(input1 == answer){
frgo3.visible = true;}
else (
{frno3.visible = false;}
}
function Moveonfr(event:MouseEvent): void{
score =score +100;
gotoAndPlay(5);
}
function Movenofr(event:MouseEvent): void{
gotoAndPlay(5);
}
我将如何解决此问题?