闪光。防止鼠标拖动孩子
我有一个带有子按钮的影片剪辑。 可以拖放影片剪辑。我想在按下/拖动子按钮时禁用影片剪辑的拖放。 mouseChildren=false
和 mouseEnable=false
不起作用,因为我想保留按钮的鼠标事件。
---------------------------------
| Movieclip --------- |
| |Button | |
| | | |
| --------- |
---------------------------------
谢谢。
I have a movieclip with a child button in it.
The movieclip can be dragged and dropped. I want to disable dragging and dropping of the movieclip when I press/drag on the child button. mouseChildren=false
and mouseEnable=false
don't work, since I want to keep my mouse events for the button.
---------------------------------
| Movieclip --------- |
| |Button | |
| | | |
| --------- |
---------------------------------
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不记得具体细节,但您可以在按钮上使用标准事件侦听器,并防止在其下方的 MovieClip 上接收这些事件。您需要在按钮的侦听处理程序中取消该事件。
http://livedocs.adobe。 com/flash/9.0/ActionScriptLangRefV3/flash/events/Event.html#stopPropagation%28%29
如果您发现MovieClip已经接收到该事件,请将您的Button侦听器更改为在事件的捕获阶段侦听(useCapture 参数添加事件监听器)。
I can't remember the specifics, but you can use standard event listeners on the button and prevent those events from being received on the MovieClip underneath it. You need to cancel the event in the button's listening handler.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/Event.html#stopPropagation%28%29
If you find that the MovieClip has already received the event, change your Button listener to listen in the capture phase of the event(useCapture parameter of addEventListener).