View comments | RSS feed

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.

Custom menu items appear at the top of the context menu, above any built-in items. A separator bar always divides custom menu items from built-in items. You can add no more than 15 custom items to a context menu. Each item must contain at least one visible character; control characters, newlines, and other white space characters are ignored. No item can be more than 100 characters long. Items that are identical to any built-in menu item, or to another custom item, are ignored, whether the matching item is visible or not. Menu items are compared without regard to case, punctuation, or white space.

None of the following words can appear in a custom item: Macromedia, Flash Player, or Settings.

Availability: ActionScript 1.0; Flash Player 7

Property summary

Modifiers

Property

Description

 

caption:String

A string that specifies the menu item caption (text) displayed in the context menu.

 

enabled:Boolean

A Boolean value that indicates whether the specified menu item is enabled or disabled.

 

separatorBefore:Boolean

A Boolean value that indicates whether a separator bar should appear above the specified menu item.

 

visible:Boolean

A Boolean value that indicates whether the specified menu item is visible when the Flash Player context menu is displayed.

Properties inherited from class Object

constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)


Event summary

Event

Description

onSelect = function(obj:Object, menuItem:Object) {}

Invoked when the specified menu item is selected from the Flash Player context menu.

Constructor summary

Signature

Description

ContextMenuItem(caption:String, callbackFunction:Function, [separatorBefore:Boolean], [enabled:Boolean], [visible:Boolean])

Creates a new ContextMenuItem object that can be added to the ContextMenu.customItems array.

Method summary

Modifiers

Signature

Description

 

copy() : ContextMenuItem

Creates and returns a copy of the specified ContextMenuItem object.

Methods inherited from class Object

addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)



Flash CS3


Comments


Lost Angel Online said on Jun 28, 2007 at 12:00 AM :
is it possible to add icons to the context menu items? and, if it is, how?

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001555.html