User Guide
924 Menu component (Flash Professional only)
myItem_obj.removeMenuItem();
clearInterval(interval_id);
my_menu.show(100, 20);
}
Menu.removeMenuItemAt()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
menuInstance.removeMenuItemAt(index)
Parameters
index The index of the menu item to remove.
Returns
A reference to the returned menu item (XML node). This value is undefined if there is no
item in that position.
Description
Method; removes the menu item and all its children at the specified index. If there is no menu
item at that index, calling this method has no effect.
Example
The following example creates a menu with two items and, after an interval of a couple of
seconds (2000 milliseconds), removes the second item (at index 1).
You first drag a Menu component to the library and then add the following code to Frame 1:
/**
Requires:
- Menu component in library
*/
import mx.controls.Menu;
// Create an XML object to act as a factory.
var my_xml:XML = new XML();
// The item created next does not appear in the menu.
// The createMenu() method call (below) expects to