有些导航按钮有效,有些则无效
我的子菜单影片剪辑中的按钮不起作用。不在子菜单内的可以正常工作。
我的代码通过验证,没有收到任何错误
知道我还应该检查什么吗?
///this one doesn't work////
aboutSub.bio.addEventListener(MouseEvent.CLICK, goBio);
function goBio(evtObj:MouseEvent) {
gotoAndStop("bio");
}
/// this one works////
home.addEventListener(MouseEvent.CLICK, gohome);
function gohome(evtObj:MouseEvent) {
gotoAndStop("home");
}
the buttons within my submenue movie clip don't work. the one's not within a submenu work fine.
my code validates and i'm not getting any errors
any idea on what else i should be checking?
///this one doesn't work////
aboutSub.bio.addEventListener(MouseEvent.CLICK, goBio);
function goBio(evtObj:MouseEvent) {
gotoAndStop("bio");
}
/// this one works////
home.addEventListener(MouseEvent.CLICK, gohome);
function gohome(evtObj:MouseEvent) {
gotoAndStop("home");
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
出于测试目的,尝试将事件侦听器添加到 aboutSub MovieClip 并查看是否有效。如果没有,请检查其上方是否有另一个 DisplayObject,并确保您没有在 aboutSub 上设置 mouseEnabled = false 或 mouseChildren = false 之类的内容。
如果它确实有效,则检查 aboutSub 剪辑中按钮等上方是否没有 DisplayObjectsw (原理与第一段相同)
for testing purposes try adding an event listener to the aboutSub MovieClip and see if that works. If it doesn't then check that you don't have another DisplayObject above it and make sure that you have not set anything like mouseEnabled = false or mouseChildren = false on the aboutSub.
If it does work then check that in aboutSub clip that there are no DisplayObjectsw above the buttons etc (so same principle as the first paragraph)