518
Chapter 7: ActionScript for Flash
Property summary for the ContextMenu class
Event handler summary for the ContextMenu class
Constructor for the ContextMenu class
Availability
Flash Player 7.
Usage
new ContextMenu ([
callBackFunction
])
Parameters
callBackFunction
A reference to a function that is called when the user right-clicks or
Control-clicks, before the menu is displayed. This parameter is optional.
Returns
A reference to a ContextMenu object.
Description
Constructor; creates a new ContextMenu object. You can optionally specify an identifier for an
event handler when you create the object. The specified function is called when the user invokes
the context menu, but
before
the menu is actually displayed. This is useful for customizing menu
contents based on application state or based on the type of object (movie clip, text field, or
button) or the Timeline that the user right-clicks or Control-clicks. (For an example of creating
an event handler, see
ContextMenu.onSelect
.)
Example
The following example hides all the built-in objects in the Context menu. (However, the Settings
and About items still appear, because they cannot be disabled.)
var newMenu:ContextMenu = new ContextMenu();
newMenu.hideBuiltInItems();
this.menu = newMenu;
In this example, the specified event handler,
menuHandler
, enables or disables a custom menu
item (using the
ContextMenu.customItems
array) based on the value of a Boolean variable
named
showItem
. If
false
, the custom menu item is disabled; otherwise, it’s enabled.
Property
Description
ContextMenu.builtInItems
An object whose members correspond to built-in context
menu items.
ContextMenu.customItems
An array, undefined by default, that contains
ContextMenuItem objects.
Property
Description
ContextMenu.onSelect
Invoked before the menu is displayed.
Содержание FLEX-FLEX ACTIONSCRIPT LANGUAGE
Страница 1: ...Flex ActionScript Language Reference...
Страница 8: ......
Страница 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Страница 76: ......
Страница 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Страница 135: ...case 135 See also break default strict equality switch...
Страница 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Страница 229: ...while 229 i 3 The following result is written to the log file 0 3 6 9 12 15 18 See also do while continue for for in...
Страница 808: ...808 Chapter 7 ActionScript for Flash...
Страница 810: ...810 Appendix A Deprecated Flash 4 operators...
Страница 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Страница 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Страница 822: ...822 Index...