User Guide
566 Chapter 6: Components Dictionary
When the event is triggered, it automatically passes an event object (eventObject) to the
handler. Each event object has properties that contain information about the event. You can use
these properties to write code that handles the event. The
Menu.rollOver event’s event object has
one additional property:
menuItem, which is a reference to the menu item (XML node) that the
pointer rolled over.
For more information, see “EventDispatcher class” on page 415.
Example
In the following example, a handler called form is defined and passed to
myMenu.addEventListener() as the second parameter. The event object is captured by the
rollOver handler in the evt parameter. When the rollOver event is broadcast, a trace
statement is sent to the Output panel.
form = new Object();
form.rollOver = function(evt){
trace("Menu rollOver: "+evt.menuItem.attributes.label);
}
myMenu.addEventListener("rollOver", form);
Menu.setMenuItemEnabled()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myMenu.setMenuItemEnabled(item, enable)
Parameters
item
An XML node; the target menu item’s node in the data provider.
enable A Boolean value indicating whether the item is enabled (true) or not (false).
Returns
Nothing.
Description
Method; changes the target item’s enabled attribute to the state specified in the enable
parameter. If this call results in a change of state, the item is redrawn with the new state.
Example
The following example disables the second child of myMenu:
var myItem = myMenu.getMenuItemAt(1);
myMenu.setMenuItemEnabled(myItem, false);