What am I REALLY clicking on!?


/ Published in: ActionScript 3
Save to your folder(s)

Will trace the name of the display object that is actually receiving mouse events. Useful when the target of your mouse event is not what you are expecting. Oh, the fix 80% of the time is mouseChildren = false;


Copy this code and paste it in your HTML
  1. addEventListener(MouseEvent.MOUSE_DOWN, function(e:MouseEvent):void{trace(e.target+" : "+e.target.name);});

Report this snippet


Comments


You need to login to view comments.