Try something like

<mx:Canvas

          contextMenu="{getyourMenu()}"

 

/>

 

private function getyourMenu () : ContextMenu {

var paste:ContextMenuItem = new ContextMenuItem("paste");

paste.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, pasteHandler);

 

var cm:ContextMenu = new ContextMenu();

                             cm.hideBuiltInItems();

                             cm.customItems.push(paste);

return cm;

}

 

 

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of lehaianh1986
Sent: 23 March 2009 10:58
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to add more context menu???

 

Hi every body. I want to add my function when I click on word in text
area (like copy, paste, ..etc). I follow the guide in
http://www.adobe.com/devnet/air/flex/quickstart/adding_menus.html
But what i want is add my function to default context menu, not instead
of remove default context menu.
Can anyone help me? Thank in advanced!!!



Disclaimer 
-------------------------------------------------------------------------------------------
This electronic message contains information which may be privileged and 
confidential. The information is intended to be for the use of the 
individual(s) or entity named above. If you are not the intended recipient, be 
aware that any disclosure, copying, distribution or use of the contents of this 
information is prohibited. If you have received this electronic message in 
error, please notify us by telephone on 0131 476 6000 and delete the material 
from your computer. 
Registered in Scotland number: SC 172507. 
Registered office address: Quay House 142 Commercial Street Edinburgh EH6 6LB. 

This email message has been scanned for viruses by Mimecast.
-------------------------------------------------------------------------------------------

Reply via email to