Example
The following example adds a menu item to a parent item and then gets the item's index within
its parent:
var myItem = myMenu.addMenuItem({label:"That item"});
var myIndex = myMenu.indexOf(myItem);
Menu.menuHide
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
listenerObject = new Object();
listenerObject.menuHide = function(eventObject){
// insert your code here
}
myMenu.addEventListener("menuHide", listenerObject)
Description
Event; broadcast to all registered listeners whenever a menu closes.
Version 2 components use a dispatcher-listener event model. When a Menu component
dispatches a
menuHide
attached to a listener object (
addEventListener()
object as parameters.
When the event is triggered, it automatically passes an event object (
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
two additional properties:
•
A reference to the MenuBar instance that is the parent of the target menu. When
menuBar
the target menu does not belong to a MenuBar instance, this value is
•
A reference to the Menu instance that is hidden.
menu
For more information, see
Example
In the following example, a handler called
myMenu.addEventListener()
handler in the
menuHide
statement is sent to the Output panel.
form = new Object();
form.menuHide = function(evt){
trace("Menu closed: "+evt.menu);
event, the event is handled by a function (also called a handler) that is
listenerObject
method and pass it the name of the handler and the name of the listener
"EventDispatcher class" on page
form
as the second parameter. The event object is captured by the
parameter. When the
evt
) that you create. You call the
Menu.menuHide
415.
is defined and passed to
event is broadcast, a
menuHide
Menu component (Flash Professional only)
) to the
eventObject
event's event object has
.
undefined
trace
561
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?