The Menu control creates a pop-up menu of individually selectable choices, similar to the File or Edit menu found in most software applications. After a Menu opens, it remains visible until it is closed by any of the following:
See Also
mx.controls.menuclasses.MenuRow
mx.controls.treeclasses.TreeDataProvider
mx.controls.treeclasses.XMLTreeDataProvider
mx.managers.PopUpManager
mx.effects.Tween
| Constructors | |
Menu
()
Constructor |
|
| Methods | |
| addMenuItem(arg:Object) : Object
Appends a menu item to the end of this menu. |
| addMenuItemAt(index:Number, arg:Object) : Object
Inserts an item into this menu at a specified location. |
| createChildren() : Void
Child construction. |
static | createMenu(parent, mdp, initObj) : Void
Returns the Menu instance described by the given MenuDataProvider, and places the instance in the given parent container. |
| getMenuItemAt(index:Number) : Object
Retrieves an item from this menu. |
| getRootMenu() : Menu
Climbs up and finds the root menu. |
| hide() : Void
If the Menu is visible, hide both it and any visible submenus. |
| indexOf(item:Object) : Number
Returns the index of an item in this menu. |
static | isItemEnabled(itm:Object) : Boolean
If true, item is enabled. |
static | isItemSelected(itm:Object) : Boolean
If true, item is selected. |
| removeAll() : Object
Removes all items from the menu. |
| removeMenuItem(item:Object) : Object
Removes an item from the menu. |
| removeMenuItemAt(index:Number) : Object
Removes the item at a given location from the menu. |
| setMenuDelay(delay:Number, request:String, args:Object) : Void
Interval functions that delay submenu tasks. |
| setMenuItemEnabled(item:Object, enable:Boolean) : Void
Marks a menu item as enabled (or not), and notifies listeners. |
| setMenuItemSelected(item:Object, select:Boolean) : Void
Marks anitem as selected (or not), and notifies listeners. |
| show(x:Number, y:Number) : Void
If the Menu isn`t visible, place the top left corner at the given coordinates within the parent, resize the menu as needed, and make it visible. |
| Methods inherited from class mx.controls.listclasses.ScrollSelectList |
calculateWidths
setPropertiesAt
|
| Methods inherited from class mx.core.ScrollView |
setScrollProperties
getViewMetrics
createChild
|
| Methods inherited from class mx.core.View |
init
draw
createChild
getChildAt
getChildIndex
setChildIndex
destroyAllChildren
destroyChild
destroyChildAt
getViewMetrics
|
| Methods inherited from class mx.core.UIComponent |
getFocus
setFocus
getFocusManager
|
| Properties | |
static | version:String
ComponentVersion is for internal use only. |
| Properties inherited from class mx.core.ScrollView |
version
className
hScrollPolicy
vScrollPolicy
hPosition
vPosition
maxVPosition
maxHPosition
|
| Properties inherited from class mx.core.View |
version
className
numChildren
|
| Properties inherited from class mx.core.UIComponent |
version
enabled
tabIndex
|
| Effects |
| Effects inherited from class mx.core.UIComponent |
showEffect
hideEffect
focusInEffect
focusOutEffect
|
| Effects inherited from class mx.core.UIObject |
creationCompleteEffect
moveEffect
resizeEffect
mouseDownEffect
mouseOverEffect
mouseOutEffect
mouseUpEffect
|
| Events | |
change | Broadcast when a user selects an item in the Menu control. The event object contains the properties: - menuBar MenuBar instance that is the parent of the selected Menu control, or undefined when the target Menu control does not belong to a MenuBar control. - menu Menu instance that was hidden, of type Menu. - menuItem Selected menu item. Access the menu item properties as: eventobj.menuItem.attributes.attribName - groupName Name of the radio-group to which the item belongs. Undefined when the target item is not in a radio group. The data type is String. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
menuShow | Broadcast when the entire menu or a submenu opens. The event object contains the properties: - menuBar MenuBar instance that is the parent of the selected Menu control, or undefined when the target Menu control does not belong to a MenuBar control. - menu Menu instance, of type Menu. - menuItem Selected menu item. Access the menu item properties as: eventobj.menuItem.attributes.attribName Target contains a reference to the component that triggered the event. Type contains the name of the event. |
menuHide | Broadcast when a menu closes. The event object contains the properties: - menuBar MenuBar instance that is the parent of the selected Menu control, or undefined when the target Menu control does not belong to a MenuBar control. - menuItem Selected menu item. Access the menu item properties as: eventobj.menuItem.attributes.attribName Target contains a reference to the component that triggered the event. Type contains the name of the event. |
rollOut | Broadcast when the cursor rolls off of a Menu item. The event object contains the properties: - menuItem Selected menu item. Access the menu item properties as:eventobj.menuItem.attributes.attribName - menu Menu instance, of type Menu. - menuBar MenuBar instance that is the parent of the selected Menu control, or undefined when the target Menu control does not belong to a MenuBar control. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
rollOver | Broadcast when the cursor rolls over a Menu item. The event object contains the properties: - menuItem Selected menu item. Access the menu item properties as:eventobj.menuItem.attributes.attribName - menu Menu instance, of type Menu. - menuBar MenuBar instance that is the parent of the selected Menu control, or undefined when the target Menu control does not belong to a MenuBar control. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
menuHide | Broadcast when the entire menu or a submenu closes. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
menuShow | Broadcast when the entire menu or a submenu opens. Target contains a reference to the component that triggered the event. Type contains the name of the event. |
| Events inherited from class: mx.controls.listclasses.ScrollSelectList |
change
itemRollOver
itemRollOut
|
| Events inherited from class: mx.core.ScrollView |
scroll
|
| Events inherited from class: mx.core.View |
childCreated
childIndexChanged
childDestroyed
|
| Events inherited from class: mx.core.UIComponent |
focusIn
focusOut
keyDown
keyUp
show
hide
valid
invalid
valueCommitted
|
| Styles | |
alternatingRowColors |
Type: Array
CSS Inheritance: yes
Colors for rows in an alternating pattern. Value can be an array of two of more colors. |
popupDuration |
Type: Number
Format: Time
CSS Inheritance: no
Duration in milliseconds of the transition as the menu opens. The value 0 specifies no transiton. The default value is 150. |
rollOverColor |
Type: Number
Format: Color
CSS Inheritance: yes
Color of the background when the link is rolled over. The default value is #0E#FFD6. |
selectionColor |
Type: Number
Format: Color
CSS Inheritance: yes
Color of the background when the link is selected. The default value is #0DFFC1. |
selectionDisabledColor |
Type: Number
Format: Color
CSS Inheritance: yes
Color The default value is 0DDDDDD. |
selectionEasing |
Type: String
CSS Inheritance: no
Reference to an easing equatjion (function) used for controlling programmating tweening. |
textDisabledColor |
Type: Number
Format: Color
CSS Inheritance: yes
The default value is #0FFFFF. |
textIndent |
Type: Number
Format: Length
CSS Inheritance: no
Offset of the first line of text from the left side of the container. The default vlue is 0. |
textRollOverColor |
Type: Number
Format: Color
CSS Inheritance: yes
The default value is #02B333C. |
textSelectedColor |
Type: Number
Format: Color
CSS Inheritance: yes
The default value is #005F33. |
| Styles inherited from class mx.core.UIObject |
color
fontFamily
fontSize
fontStyle
fontWeight
textAlign
textDecoration
textIndent
marginLeft
marginRight
horizontalGap
verticalGap
|
| Constructor Detail |
Menu()
| Method Detail |
addMenuItem(arg:Object) : Object
Parameters
arg - May be one of the following: a String, to be used as the item`s label; an Object, whose properties are copied into the resulting XMLNode`s attributes; an XMLNode, used directly; or an XML instance whose firstChild will be cloned and used.
Returns
XMLNode that carries a representation of the menu item's state.
addMenuItemAt(index:Number, arg:Object) : Object
Parameters
index - Index where the item should be inserted.
arg - May be one of the following: a String, to be used as the item`s label; an Object, whose properties are copied into the resulting XMLNode`s attributes; an XMLNode, used directly; or an XML instance whose firstChild is cloned and used.
Returns
XMLNode carrying a representation of the menu item's state
createChildren() : Void
static createMenu(parent, mdp, initObj) :
Void
Parameters
parent - Container.
mdp - MenuDataProvider on which to base the menu.
initObj -
Returns
Menu instance, already placed inside the parent, but invisible.
getMenuItemAt(index:Number) : Object
Parameters
index - Index of the item to retrieve.
Returns
Reference to the XMLNode that was removed.
getRootMenu() : Menu
hide() : Void
indexOf(item:Object) : Number
Parameters
item - Target item.
Returns
Index of the item, or undefined.
static isItemEnabled(itm:Object) : Boolean
Parameters
itm - Item whose state to determine.
static isItemSelected(itm:Object) : Boolean
Parameters
itm - Item whose state to determine.
removeAll() : Object
removeMenuItem(item:Object) : Object
Parameters
item - Item to remove.
Returns
Reference to the XMLNode that was removed, or undefined if the item does not belong to this Menu instance.
removeMenuItemAt(index:Number) : Object
Parameters
index - Index of the item to remove.
Returns
Reference to the XMLNode that was removed, if any.
setMenuDelay(delay:Number, request:String, args:Object) : Void
Parameters
delay -
request -
args -
setMenuItemEnabled(item:Object, enable:Boolean) : Void
Parameters
item - Target item.
enable - Boolean that indicates whether or not the item is enabled.
setMenuItemSelected(item:Object, select:Boolean) : Void
Parameters
item - Target item.
select - Boolean that indicates whether or not the item is selected
show(x:Number, y:Number) : Void
Parameters
x - Horizontal location of the top left corner (optional).
y - Vertical location of the top left corner (optional).
| Property Detail |
static version:String