简体   繁体   中英

Flex Air RollOver on inactive Native Window

I have a Native Window in Flex AIR. Let's say the window doesn't have a focus. It is inactive. Is it possible to find out when mouse is over such window? The window is always in front. I heard that it is possible by checking stage.mouseX in ENTER FRAME handler. But maybe there is a more elegant solution?

I would look into using the MouseEvent.MOUSE_OVER event; which I would expect to fire whenever the mouse enters the window.

The only issue I see is that the NaiveWindow class does not document mouse events. So, the mouse event will most likely have to be dispatched from one of the children of the NativeWindow. You may try adding aa transparent image as the background, or something similar, and listen for the event on that image.

Not sure what you mean by you have a NativeWindow, but if you've extended spark.components.Window (which is the way you should be creating a window) and add a MouseEvent.MOUSE_MOVE listener to it then that will be triggered whenever the mouse is moving over the window, regardless of whether or not the window or application itself has focus.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM