I think the problem here is that you are using the same name for your
menu item as one of the built in menu items. These include
forwardAndBack, loop, play, print, quality, rewind, save and zoom. Set
the label of your menu item to anything but these and it should work.

-Adam

--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Looks ok to me.  Make sure you're right clicking on the app and not
> something that has its own context menu
> 
>  
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of vipinck
> Sent: Tuesday, July 29, 2008 3:14 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Custom Context Menu in flex app
> 
>  
> 
> I am trying to add a custom context menu in my flex app. I am writing
> below code in a method which i am calling on applicationComplete event
> of the main application.
> 
> //
> customMenu = new ContextMenu();
> var saveItem:ContextMenuItem = new
> ContextMenuItem("Save",true,true,true);
> saveItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
> doSaveCommand);
> customMenu.hideBuiltInItems();
> customMenu.customItems.push(saveItem);
> Application.application.contextMenu = customMenu;
> 
> //
> 
> I am able to hide the default menu items when using the
> customMenu.hideBuiltInItems(); code, but the custom 'Save' item is not
> getting added.
> 
> What could be wrong?
> 
> Thnx
> Vipin
>


Reply via email to