User Guide
MenuDataProvider class 933
my_xml.addMenuItem({label:"Quit", instanceName:"miQuit"});
// Create and show the menu.
var my_menu:Menu = Menu.createMenu(myParent_mc, my_xml);
my_menu.show(100, 20);
See also
Menu.hide()
MenuDataProvider class
ActionScript Class Name mx.controls.menuclasses.MenuDataProvider
The MenuDataProvider class is a decorator (mix-in) class that adds functionality to the
XMLNode global class. This functionality lets XML instances assigned to a
Menu.dataProvider property use the MenuDataProvider methods and properties to
manipulate their own data as well as the associated menu views.
Keep in mind these concepts about the MenuDataProvider class:
■ MenuDataProvider is a decorator (mix-in) class. You do not need to instantiate it to use it.
■ Menus natively accept XML as a dataProvider property value.
■ If a Menu class is instantiated, all XML instances in the SWF file are decorated by the
MenuDataProvider class.
■ Only MenuDataProvider methods broadcast events to the Menu components. You can
still use native XML methods, but they do not broadcast events that refresh the Menu
views. To control the data model, use MenuDataProvider methods. For read-only
operations like moving through the Menu hierarchy, use XML methods.
■ All items in the Menu component are XML objects decorated with the
MenuDataProvider class.
■ Changes to item attributes are not reflected in the onscreen menu until redrawing occurs.