views:

123

answers:

1

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.stopImmediatePropagation(); 
 e.preventDefault();
}
+3  A: 

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

Patrick