I am trying to "close" the context menu programmatically but with no luck. The reason I am doing it is because in our mapping app, when the user right-clicks on the marker (icon on the map), context menu for the marker displays, at the same time, the map pans so that the marker gets centered on the map. This results in a weird situation as the context menu still displays while its marker is no longer under the cursor.
I did a bit search online and I had tried two tricks, one is to use an context menu with no items to replace the existing context menu; the other one is try to fire a mouse click event from stage programmatically once the marker slides out from under the cursor. Neither has any effect. I was also looking into PopupManager but its removePopup method takes an IFlexDisplayObject as parameter while FlexNativeMenu just directly inherits from EventDispatcher.