0
votes

I defined the contextmenu,and add it into button,label,and textinput,but when I right click the textinput component,it dose not work well.but for button, it works.

in textinput it is like the default contextmenu override mine.what I should do to display my menu?

var myContextMenu:ContextMenu=new ContextMenu();
myContextMenu.hideBuiltInItems();
myContextMenu.clipboardMenu=false;

var myContextMenuItem:ContextMenuItem=new ContextMenuItem("tt");
myContextMenu.customItems=myContextMenu.customItems.concat(myContextMenuItem);

how I prevent textinput the focus,stop the selection operate??

1

1 Answers

1
votes

In flex 4.6 spark TextInput use property textDisplay like:

var myContextMenu:ContextMenu=new ContextMenu();
myContextMenu.hideBuiltInItems();
myContextMenu.clipboardMenu=false;

var myContextMenuItem:ContextMenuItem=new ContextMenuItem("tt");
myContextMenu.customItems=myContextMenu.customItems.concat(myContextMenuItem);
RichEditableText(myInput.textDisplay).contextMenu = myContextMenu;