代码有效但返回 以下错误 -
TypeError:错误#1009:无法访问null的属性或方法 object reference.at lost_fla :: MainTimeline / check() [lost_fla.MainTimeline :: frame1:44]
trace(smb_btn)= null
trace(check)= function(){}
trace(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");
}
}
答案 0 :(得分:0)
您应该验证文本字段的名称和您的按钮的名称,它们的名称应该与代码中的拼写完全相同,并且在设计它们所在的MC时应该指定名称。
答案 1 :(得分:0)
Apple收到该软件时出错并批准。由于错误不会造成任何问题,我相信这并没有被认真对待,但它仍然存在,我只是忽略了它的存在。我感谢大家的帮助。 Vesper的特殊坦克。