> cm.customItems = [cmi];
> cm.customItems = [cmii];
>
cm.customItems is an Array.. and here you are reinitializing it ...
Bellow is the right way to declare array with multiple items ..
private function init():void {
var cmi:ContextMenuItem = new ContextMenuItem("View
item...", true);
cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
contextMenuItem_menuItemSelect);
// Your New Menu
var cmi2:ContextMenuItem = new ContextMenuItem("Edit
item...", true);
cmi2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
contextMenuItem_menuItemSelect);
cm = new ContextMenu();
cm.hideBuiltInItems();
cm.customItems = [cmi,cmi2];
cm.addEventListener(ContextMenuEvent.MENU_SELECT,
contextMenu_menuSelect);
}
On Fri, Nov 14, 2008 at 6:14 AM, dhileepen chakravarthy <[EMAIL PROTECTED]
> wrote:
> Thank you satish,
> Exactly right.
>
> but how to add my menus
>
> For example,
> var cmi:ContextMenuItem = new ContextMenuItem("Open...",
> true);
> cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
> contextMenuItem_menuItemSelect);
>
> cm = new ContextMenu();
> cm.hideBuiltInItems();
> cm.customItems = [cmi];
> cm.addEventListener(ContextMenuEvent.MENU_SELECT,
> contextMenu_menuSelect);
>
>
> I am trying like below,
>
> var cmi:ContextMenuItem = new ContextMenuItem("Open...",
> true);
> cmi.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
> contextMenuItem_menuItemSelect);
> var cmii:ContextMenuItem = new ContextMenuItem("Update...",
> true);
> cmii.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
> contextMenuItem_menuItemSelect1);
>
> cm = new ContextMenu();
> cm.hideBuiltInItems();
> cm.customItems = [cmi];
> cm.customItems = [cmii];
> cm.addEventListener(ContextMenuEvent.MENU_SELECT,
> contextMenu_menuSelect);
>
>
> above only display Update...
>
> I need the both Please help
>
>
> Regards,
> Dhileepen
>
> >
>
--
Warm Regards,
Sathish Kumar T
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---