我正在为我的技术类在flash中进行测验,我得到了这个错误,并且“1061:通过带有静态类型Class的引用调用可能未定义的方法addEventListener。”。这是我的代码
black_mc.buttonMode = true;
red_mc.buttonMode = true;
purple_mc.buttonMode = true;
black_mc.addEventListener(MouseEvent.CLICK, feedback);
red_mc.addEventListener(MouseEvent.CLICK, feedback);
purple_mc.addEventListener(MouseEvent.CLICK, feedback);
function feedback(event:MouseEvent):void
{ if (event.target.name == "black_mc")
{
feedback_txt.text = "Bruh thats a black rectangle lmao";
}
else if(event.target.name=="red_mc")
{
feedback_txt.text = "You flaggin man thats a red square lolol";
event.target.parent.removeChild(event.target);
}
else if(event.target.name=="purple_mc")
feedback_txt.text = "Ayyyy you got it bruh!"
event.target.parent.removeChild(event.target);
}
我检查了所有符号的链接,它们很好。不知道为什么会出现这个错误