ActionScript 2.0 Language Reference |
|
|
|
| ActionScript classes > ContextMenuItem > caption (ContextMenuItem.caption property) | |||
public caption : String
A string that specifies the menu item caption (text) displayed in the context menu.
Availability: ActionScript 1.0; Flash Player 7
The following example displays the caption for the selected menu item (Pause Game) in the Output panel:
var my_cm:ContextMenu = new ContextMenu();
var menuItem_cmi:ContextMenuItem = new ContextMenuItem("Pause Game", onPause);
my_cm.customItems.push(menuItem_cmi);
function onPause(obj, menuItem) {
trace("You chose: " + menuItem.caption);
}
this.menu = my_cm;
|
|
|
|