Click 的 AddEventListener 不适用于 AS2.0 和 Flash Player 10
我有来自 Adobe 的以下代码:
myListener = new Object();
myListener.click = function(evt){
trace(evt.type + " triggered");
}
myButton.addEventListener("click", myListener);
但这不起作用,尽管舞台上的 btn 具有与代码中相同的实例名称。
I have the following code from Adobe:
myListener = new Object();
myListener.click = function(evt){
trace(evt.type + " triggered");
}
myButton.addEventListener("click", myListener);
But this does not work though the btn on stage have the same Instance name as in code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
提供的代码仅适用于实际的按钮组件。按钮symbol不会调度
click
事件,并且没有addEventListener
方法。您必须将代码更改为:The code provided only works with the actual button component. A button symbol does not dispatch a
click
event and does not have anaddEventListener
method. You would have to change your code to: