该代码有效,但返回以下错误 -
TypeError:错误#1009:无法访问空对象引用的属性或方法。在lost_fla :: MainTimeline / check()[lost_fla.MainTimeline :: frame1:44]
跟踪 (smb_btn) = null
跟踪(检查)=函数(){}
跟踪 (txt_inpt) = null
有什么办法可以改变空值?
import fl.controls.Button
import fl.controls.TextInput
import flash.utils.Timer
import flash.events.MouseEvent
smb_btn.addEventListener (MouseEvent.CLICK, check);
function check (e:MouseEvent):void{
if (txt_inpt.text == "12345"){
hotel++
gotoAndPlay (952, "Cena 2");
trace(smb_btn)
trace(txt_inpt)
}
if (txt_inpt.text == "131313"){
gotoAndPlay (735, "Cena 3");
}
if (txt_inpt.text == "t"){
gotoAndPlay (693, "Cena 3");
}
if (txt_inpt.text == "141414"){
gotoAndPlay (727, "Cena 4");
}
if (txt_inpt.text == "maze"){
SoundMixer.stopAll();
gotoAndPlay (483,"Cena 7");
}
if (txt_inpt.text == "54321"){
gotoAndPlay (239,"Cena 4");
}
if (txt_inpt.text == "12123"){
gotoAndPlay (358,"Cena 3");
}
if (txt_inpt.text == "191918"){
stone++
stone++
stone++
SoundMixer.stopAll();
gotoAndPlay (950,"Cena 8");
}
}