开发者

How to prevent a parent movieclip event from being fired

开发者 https://www.devze.com 2023-02-18 01:28 出处:网络
I have an AS3 movieclip with a button. Both the movieclip and bu开发者_Python百科tton needs a click event but when I click the button it also fires the parent movieclip\'s event handler.

I have an AS3 movieclip with a button. Both the movieclip and bu开发者_Python百科tton needs a click event but when I click the button it also fires the parent movieclip's event handler.

Is there a way to stop this behaviour?


Add an event listener to the child button and use stopImmediatePropagation() to prevent the event from bubbling any further up the display list.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号