カスタムカーソルとコンテキストメニューが併用できない
UserGroupにも書かせていただいてますが、CursorManagerでカーソルを変更すると、設定したcontextMenuが開かなくなります。
Applicationのメニューが立ち上がるので、イベントハンドラが死んでいるか、あるいは自身が設定したカーソルのインスタンスそのものを検出しているかではなかろうかと。
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="{init()}"> <mx:Canvas id="canvas1" x="10" y="10" width="130" height="111" backgroundColor="#c0c0c0" mouseOver="{onMouseOver(event)}" mouseOut="{onMouseOut(event)}"> </mx:Canvas> <mx:Canvas id="canvas2" x="148" y="10" width="182" height="111" backgroundColor="#c0c0c0"> </mx:Canvas> <mx:Script> <![CDATA[ import mx.managers.CursorManager; private function onMouseOver(e:MouseEvent):void { CursorManager.setBusyCursor(); } private function onMouseOut(e:MouseEvent):void { CursorManager.removeBusyCursor(); } private var context1:ContextMenu; private var context2:ContextMenu; private function init():void { context1 = new ContextMenu(); context1.customItems.push(new ContextMenuItem("TEST")); canvas1.contextMenu = context1; context1.addEventListener(ContextMenuEvent.MENU_SELECT, onMenuSelect); context2 = new ContextMenu(); context2.customItems.push(new ContextMenuItem("TEST")); canvas2.contextMenu = context2; context2.addEventListener(ContextMenuEvent.MENU_SELECT, onMenuSelect); } private function onMenuSelect(e:ContextMenuEvent):void { trace("event.mouseTarget:"+e.mouseTarget); } ]]> </mx:Script> </mx:Application>