【发布时间】:2013-07-22 04:46:37
【问题描述】:
代码有效但返回 以下错误 -
TypeError: 错误 #1009: 无法访问 null 的属性或方法 object reference.at lost_fla ::MainTimeline / check() [lost_fla.MainTimeline :: frame1: 44]
trace (smb_btn) = null
跟踪(检查)=函数(){}
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");
}
}
【问题讨论】:
-
dropbox.com/s/jnn9sofj42tqey2/lost.fla
标签: actionscript-3 flash function null