-2

该代码有效,但返回以下错误 -

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");
            }
        }
4

2 回答 2

0

您应该验证您的文本字段和按钮的名称,它们的名称应该与代码中的拼写完全一样,并且应该在设计它们所在的 MC 时指定名称。

于 2013-07-22T05:04:50.043 回答
0

Apple 收到错误的软件并批准。由于该错误甚至不会引起问题,因此我认为它没有被认真对待,但它仍然存在,我只是忽略了它的存在。我感谢大家的帮助。Vesper的特殊坦克。

于 2013-08-20T05:46:20.750 回答