Contextmenuitem - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Parameters
- A reference to the object (movie clip, button, or selectable text field) that was
item:Object
under the mouse pointer when the Flash Player context menu was invoked and whose
property is set to a valid ContextMenu object.
- A reference to the ContextMenu object assigned to the
item_menu:Object
.
object
Example
The following example determines over what type of object the context menu was invoked.
my_cm:ContextMenu = new ContextMenu();
function menuHandler(obj:Object, menu:ContextMenu) {
if(obj instanceof MovieClip) {
trace("Movie clip: " + obj);
}
if(obj instanceof TextField) {
trace("Text field: " + obj);
}
if(obj instanceof Button) {
trace("Button: " + obj);
}
}
my_cm.onSelect = menuHandler;
my_mc.menu = my_cm;
my_btn.menu = my_cm;

ContextMenuItem

Object
|
+-ContextMenuItem
public dynamic class ContextMenuItem
extends Object
The ContextMenuItem class allows you to create custom menu items to display in the Flash
Player context menu. Each ContextMenuItem object has a caption (text) that is displayed in
the context menu, and a callback handler (a function) that is invoked when the menu item is
selected. To add a new context menu item to a context menu, you add it to the customItems
array of a ContextMenu object.
You can enable or disable specific menu items, make items visible or invisible, or change the
caption or callback handler associated with a menu item.
menu
property of
menu
ContextMenuItem
449

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF