Hello,
I have a very simple AIR app (Flex 3.4.1, source below…), that has only two things:
- a canvas with an event listener to trace the mouse location
- a simple context menu
I notice that the event listener for the mouse move seems to stop working when I do the following:
a. pop up the context menu
b. highlight the “test” item but do not select it
c. close the popup by clicking off the menu (on the canvas)
I am using Mac OS X (Snow Leopard), and I further notice that if I press Command-~ (as if I were toggling open windows) the listener returns. Lastly, I notice that if I pop up the menu but don’t highlight the item before clicking off, everything works as expected.
All of this leads me to believe that somehow highlighting the menu item creates a “window” that isn’t being properly disposed of in this particular case when I click off - does anybody have a suggestion of what might be going on here?
Thank you,
Chris Stolte
<mx:WindowedApplication layout=“absolute” applicationComplete=“init()”
xmlns:mx=“http://www.adobe.com/2006/mxml”>
<mx:Script>
<![CDATA[
private function init():void {
// Listener to trace mouseX property
myCanvas.addEventListener(MouseEvent.MOUSE_MOVE,
function (e:MouseEvent):void {
trace(myCanvas.mouseX);
});
// Create a simple context menu
myCanvas.contextMenu= new ContextMenu();
myCanvas.contextMenu.addItem(new NativeMenuItem("test"));
}
]]>
</mx:Script>
<mx:Canvas id="myCanvas" height="50%" width="50%" backgroundColor="0x00FF00"/>
</mx:WindowedApplication>