Hi, Try this:
_ti.label.menu = cm; Where _ti is instance of TextInput. ###Modified Code## class CellEditor extends mx.controls.TextInput { var _cm = null; function CellEditor() { _cm = new ContextMenu(); _cm.customItems.push(new ContextMenuItem(new ContextMenuItem ("Details", details))); this.label.menu = _cm; } function details(item:mx.controls.TextInput, mi:ContextMenuItem) :Void { trace("Selected " + mi.caption); } } -abdul -----Original Message----- From: viraf_bankwalla [mailto:[EMAIL PROTECTED] Sent: Saturday, March 26, 2005 2:26 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] edit ContextMenu When I right-click in a TextInput I get the edit menu. How do I add items to this edit ContextMenu ? I tried the following, however the compiler complains that there is no property with the name Menu. class CellEditor extends mx.controls.TextInput { var _cm = null; function CellEditor() { _cm = new ContextMenu(); _cm.customItems.push(new ContextMenuItem(new ContextMenuItem ("Details", details))); this.menu = _cm; } function details(item:mx.controls.TextInput, mi:ContextMenuItem) :Void { trace("Selected " + mi.caption); } } Thanks Yahoo! Groups Links Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/