flex - Custom ContextMenu not displaying in MX TextArea -
been tearing hair out ages trying custom contextmenu apply textarea, display default (copy, paste ect...).
import mx.events.flexevent; public var nm:nativemenu = new nativemenu(); public var cm:contextmenu = new contextmenu(); protected function windowedapplication1_creationcompletehandler(event:flexevent):void { cm.clipboardmenu = true; var cmi:contextmenuitem = new contextmenuitem("ctest"); cm.additem(cmi); ta.contextmenu = cm; } given ta mx textarea in mxml
i'm stumped!
just put full set of code see:
var cm:contextmenu = new contextmenu(); var menuitem:contextmenuitem = new contextmenuitem("check spelling"); menuitem.addeventlistener(contextmenuevent.menu_item_select, handlecontextmenuevent); mainmenu.additem(menuitem); textarea.contextmenu = mainmenu; var txt:textfield = textarea.mx_internal::gettextfield() textfield; txt.contextmenu = mainmenu; hope helps!
Comments
Post a Comment