Flex captures all mouse clicks on the application

I want to capture every mouse event and I tried to add event listeners to FlexGlobals.topLevelApplication. However, there are some cases (for example, the Flex Menu class) where clicks are not captured - perhaps somewhere the propagation of events stops. For example, in SystemManager.as, I found this:

 addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, true, 1000);

      

... which seems to override my listener. Also I tried to add Listeners with int.MAX_VALUE priority but with no success.

So my question is, how can I capture all the mouse clicks without worrying about my events being stopped somewhere? Maybe some javascript to hack? Or maybe add event listeners somewhere where there is no way to cancel them? Thank.

+3


source to share


1 answer


You can try adding an event handler to the capture frame:



systemManager.stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseEventHandler, true, Integer.MAX_VALUE);

      

+1


source







All Articles