3 Replies Latest reply on Feb 21, 2008 7:03 AM by Gregory Lafrance

    Popup menu in Flex problem

    Flex-Issac
      Hi all,

      I have a treeview control, it allow user click a item for selection to retrieve data. And It also want to use Popup menu to modify the tree item (e.g. copy, remove, rename). But the problem is how to hide flash default context menu when right click mouse? Othrwise my custom menu cannot be show? I tried to change to use double click in item to show the menu, but the normal click item event would cover this event. Anyone has idea to solve it?

      Thanks,
        • 1. Re: Popup menu in Flex problem
          jfillman Level 1
          You cannot hide the Flash context menu. You can add your own items to it, but you cannot completely hide it. With that said, some have tried to hack around this, and I believe there is something that works in IE 6, but not IE 7. Now if you want to use AIR, you have the ability to create your own right click menu.
          • 2. Re: Popup menu in Flex problem
            Flex-Issac Level 1
            Thanks,

            Then how could I modify original Flash context menu? If I can add my own item to it that would be OK.

            • 3. Re: Popup menu in Flex problem
              Gregory Lafrance Level 6
              See the FB 2.0.1 help topic on "Class ContextMenu".

              "To add new items to a ContextMenu object, you create a ContextMenuItem object, and then add that object to the ContextMenu.customItems array. For more information about creating context menu items, see the ContextMenuItem class entry.

              Flash Player has three types of context menus: the standard menu (which appears when you right-click in Flash Player), the edit menu (which appears when you right-click a selectable or editable text field), and an error menu (which appears when a SWF file has failed to load into Flash Player). Only the standard and edit menus can be modified with the ContextMenu class.

              Custom menu items always appear at the top of the Flash Player context menu, above any visible built-in menu items; a separator bar distinguishes built-in and custom menu items. You can add no more than 15 custom items to a context menu. You cannot remove the Settings menu item from the context menu. The Settings menu item is required in Flash so that users can access the settings that affect privacy and storage on their computers. You also cannot remove the About menu item, which is required so that users can find out what version of Flash Player they are using."