2
在我的第一个AS3项目中(自AS1以来未使用Flash)我需要将自定义影片剪辑用作光标并检测点击按钮。使用下面的代码,自定义游标按预期工作,但我无法捕获点击按钮。AS3 - 使用鼠标移动侦听器时无法捕获按钮点击
如果我注释掉第一行,单击的跟踪按预期工作。我尝试改变事件监听器的顺序,将按钮应用于按钮而不是舞台,但无法让两者协同工作。
任何意见,我要去哪里错应该被赞赏。
stage.addEventListener(MouseEvent.MOUSE_MOVE,follow);
start_button.addEventListener(MouseEvent.MOUSE_UP, playPhrase);
function playPhrase(event:MouseEvent) {
trace("Click received");
};
function follow(event:MouseEvent) {
cursor.x = mouseX;
cursor.y = mouseY;
};
完美。非常感谢。 – peteredhead 2012-03-18 20:52:45