I'm trying to add an extra menu item to the right click context menu 
to appear over a bitmap.

I've successfully added the code and it works *sometimes* ... and 
there lies my problem.

It may work the first time, it may work all the time or it may work 
never but for some reason, the main default context menu normally 
replaces my default menu.

I'm setting the Image's ContextMenu via the mxml and altering said 
context menu in the CDATA script.

Is there anything obvious I should be looking for?

Cheers, Phill.

[Bindable] 
public var itsRightClickContextMenu:ContextMenu;
.
.
.

private function addCustomContextMenu():void 
{ 
var cmi:ContextMenuItem= new ContextMenuItem("DO STUFF", true); 
cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, 
contextMenuItem_menuItemSelect); 

itsRightClickContextMenu= new ContextMenu(); 
itsRightClickContextMenu.hideBuiltInItems(); 
itsRightClickContextMenu.customItems.push(cmi); 
}
.
.
.
<mx:Image id="bitmapFitToWindow" 
width= "100%" height="100%" 
contextMenu="{itsRightClickContextMenu}"
.
.
.



Reply via email to