I'm building an application for AIR, written in AS3, and sometimes (most of the time), when I move my mouse over the right-click menu (I've tried both ContextMenu and NativeMenu - am currently using NativeMenu because of needed submenus), the Video object slows down significantly (it is showing the image of a local webcam), and the FPS counter also drops (obviously). This happens both while debugging, and while runnning the application after installing. It's a real deal breaker, I would really appreciate some help. I've yet to find anything resembling this on the Internet, it's really weird.
This is because the ContextMenu needs to be drawn through Windows GDI (software level) and your Flash video object is beeing rendered through the GPU (of course it could be fixed by Adobe, but as of now they haven't).
The only solution is to pause the video (or remove it from stage) before the ContextMenu appears, by catching ContextMenuEvent.MENU_SELECT on all existing ContextMenu objects (if there are none, add one for each object which inherits InteractiveObject added directly to the stage
).
If you want to resume the video playback, you will have to accept some limitations. Since there is no event on close of a ContextMenu, you need to rely on
In some situations you won't be able to detect the closing of the ContextMenu, such as