开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜