How can I remove the default right click option of the text Area control?

18 views
Skip to first unread message

Laishram

unread,
Oct 18, 2012, 1:53:58 PM10/18/12
to flex_...@googlegroups.com

Komal H

unread,
Oct 31, 2012, 5:02:19 AM10/31/12
to Flex India Community
set the property--> mouseEnabled="false"

On Oct 18, 10:53 pm, Laishram <ashok.laish...@gmail.com> wrote:
>

Komal H

unread,
Oct 31, 2012, 5:19:27 AM10/31/12
to Flex India Community
Set the property--> mouseEnabled="false"

Prashant Joshi

unread,
Nov 1, 2012, 1:57:04 AM11/1/12
to flex_...@googlegroups.com

You can try perventDefault()  fo Event Class for overriding default behavior .

On Wed, Oct 31, 2012 at 2:32 PM, Komal H <krha...@gmail.com> wrote:
set the property-->   mouseEnabled="false"

On Oct 18, 10:53 pm, Laishram <ashok.laish...@gmail.com> wrote:
>

--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.





 

Ashok Laishram

unread,
Nov 1, 2012, 1:56:01 AM11/1/12
to flex_...@googlegroups.com
It's not working if I set this property also , the default right click
option still exists

On Wed, Oct 31, 2012 at 2:49 PM, Komal H <krha...@gmail.com> wrote:
> Set the property--> mouseEnabled="false"
>

sudesh das

unread,
Nov 1, 2012, 8:40:46 AM11/1/12
to flex_...@googlegroups.com
Hello Ashok

you can enable and disable the context menu option from the context menu. Check the below example 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="onInit()">
<mx:Script>
<![CDATA[
import mx.managers.FocusManager;
import mx.core.UIComponent;
private var _spr:Sprite;
private var _contextMenu:ContextMenu;
private function onInit():void
{
var ui:UIComponent = new UIComponent();
_spr = new Sprite();
_spr.graphics.clear();
_spr.graphics.beginFill(0xFF0000,0.8);
_spr.graphics.drawRect(0,0,200,200);
_spr.graphics.endFill();
ui.addChild(_spr);
_spr.x = 20;
_spr.y = 20;
addChild(ui);
loadContextMenu();
}
private function loadContextMenu():void
{
_contextMenu = new ContextMenu();
_contextMenu.hideBuiltInItems();
var _selAll:ContextMenuItem = new ContextMenuItem("Select All Hotspot");
var _deSelAll:ContextMenuItem = new ContextMenuItem("Deselect All Hotspot");
var _delAll:ContextMenuItem = new ContextMenuItem("Delete All Hotspot");
_contextMenu.customItems.push(_selAll);
_contextMenu.customItems.push(_deSelAll);
_contextMenu.customItems.push(_delAll);
_contextMenu.customItems[1].enabled = false;
_contextMenu.customItems[2].enabled = false;
_selAll.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menuItemSelect);
_delAll.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menuItemSelect);
_deSelAll.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menuItemSelect);
_spr.contextMenu = _contextMenu;
}
private function menuItemSelect(evt:ContextMenuEvent):void
{
var _custMenu:ContextMenuItem = evt.target as ContextMenuItem;
if(_custMenu.caption == "Select All Hotspot")
{
_contextMenu.customItems[0].enabled = false;
_contextMenu.customItems[1].enabled = true;
_contextMenu.customItems[2].enabled = true;
}
else
{
_contextMenu.customItems[0].enabled = true;
_contextMenu.customItems[1].enabled = false;
_contextMenu.customItems[2].enabled = false;
}
}
]]>
</mx:Script>
</mx:Application>
Reply all
Reply to author
Forward
0 new messages