Skip to main content
March 11, 2011
Question

Right click context menu

  • March 11, 2011
  • 1 reply
  • 546 views

Hi,

I have created a Text editor using TLF 2 with RichEditableText component. When I right click the editor I get a context menu with cut/copy/paste/delete/select all options.

I need to customize this context menu with the actions I want to add. But I can't find in the code how that context menu appears.

I can see the same context menu in the TLF demo also (http://labs.adobe.com/technologies/textlayout/demos/). But couldn't find the code how/where it is get called when right clicked.

Please explain to me how that happens. What is the event fired for right click and where it is handled in the TLF and how the context menu is added.

Thanks

This topic has been closed for replies.

1 reply

March 14, 2011

No replies yet

I did it this way - http://blog.flexexamples.com/2007/12/31/creating-a-custom-context-menu-on-a-richtexteditor-control-in-flex/

Created a ContextMenu and added it to my RichEditableText

            var showSelection:ContextMenuItem = new ContextMenuItem("Menu Item 1");
            showSelection.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, showSelection_menuItemSelect);
                   
           
            cm = new ContextMenu();
            cm.hideBuiltInItems();
            cm.customItems.push(showSelection);

            var retEditor:RichEditableText = new RichEditableText();
            retEditor.contextMenu = cm;