开发者

Actionscript 3: Preventing mouse events *except* for a specific button/movieclip?

开发者 https://www.devze.com 2022-12-19 06:30 出处:网络
Is there a way to block mouse events except for a specific MovieClip or Sprite? i.e. I know that to prevent ALL mouse clicks, I can write something like:

Is there a way to block mouse events except for a specific MovieClip or Sprite?

i.e. I know that to prevent ALL mouse clicks, I can write something like:

stage.addEventListener(MouseEvent.CLICK, onPreventClick, true, 0, true);
...
private function onPreventClick(e:MouseEvent) {
    e.stopIm开发者_运维知识库mediatePropagation(); 
 e.preventDefault();
}


You can check e.currentTarget to find the object who fired the Event and doing your filtering according to that.

0

精彩评论

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