An InteractiveObject dispatches a ContextMenuEvent object when the user
opens or interacts with the context menu. There are two types of
ContextMenuEvent objects:
ContextMenuEvent.MENU_ITEM_SELECT
ContextMenuEvent.MENU_SELECT
Static variables
staticinlineread onlyMENU_ITEM_SELECT:EventType<ContextMenuEvent> = "menuItemSelect"
Defines the value of the type
property of a menuItemSelect
event
object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
contextMenuOwner | The display list object to which the menu is attached. |
currentTarget | The object that is actively processing the Event object with an event listener. |
mouseTarget | The display list object on which the user right-clicked to display the context menu. |
target | The ContextMenuItem object that has been selected. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
staticinlineread onlyMENU_SELECT:EventType<ContextMenuEvent> = "menuSelect"
Defines the value of the type
property of a menuSelect
event
object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
contextMenuOwner | The display list object to which the menu is attached. |
currentTarget | The object that is actively processing the Event object with an event listener. |
mouseTarget | The display list object on which the user right-clicked to display the context menu. |
target | The ContextMenu object that is about to be displayed. The target is not always the object in the display list that registered the event listener. Use the currentTarget property to access the object in the display list that is currently processing the event. |
Constructor
new(type:String, bubbles:Bool = false, cancelable:Bool = false, ?mouseTarget:InteractiveObject, ?contextMenuOwner:InteractiveObject)
Creates an Event object that contains specific information about menu events. Event objects are passed as parameters to event listeners.
Parameters:
type | The type of the event. Possible values are:
|
---|---|
bubbles | Determines whether the Event object
participates in the bubbling stage of the
event flow. Event listeners can access this
information through the inherited |
cancelable | Determines whether the Event object can be
canceled. Event listeners can access this
information through the inherited |
mouseTarget | The display list object on which the user
right-clicked to display the context menu.
This could be the |
contextMenuOwner | The display list object to which the menu is
attached. This could be the |
Variables
contextMenuOwner:InteractiveObject
The display list object to which the menu is attached. This could be
the mouse target (mouseTarget
) or one of its ancestors in the
display list.
mouseTarget:InteractiveObject
The display list object on which the user right-clicked to display the
context menu. This could be the display list object to which the menu
is attached (contextMenuOwner
) or one of its display list
descendants.
The value of this property can be null
in two circumstances: if
there no mouse target, for example when you mouse over something from
the background; or there is a mouse target, but it is in a security
sandbox to which you don't have access. Use the
isMouseTargetInaccessible()
property to determine which of these
reasons applies.