// receive a root element whose children will become
// the items. This is just a simple way to create that
// root element and give it a convenient name.
var menuDP_obj:Object = my_xml.addMenuItem("XXXXX");
// Add the menu items.
menuDP_obj.addMenuItem({label:"1st Item"});
menuDP_obj.addMenuItem({label:"2nd Item"});
// Create the Menu object.
var my_menu:Menu = Menu.createMenu(this, menuDP_obj);
// Show and position the menus.
my_menu.show(100, 20);
var interval_id:Number = setInterval(remove, 2000, my_menu);
function remove(the_menu:Menu):Void {
// Delete the 2nd node item.
var item_obj:Object = my_menu.removeMenuItemAt(1);
trace("Item removed: " + item_obj);
clearInterval(interval_id);
the_menu.show(100, 20);
}
Menu.rollOut
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
Usage 1:
var listenerObject:Object = new Object();
listenerObject.rollOut = function(eventObject:Object) {
// Insert your code here.
};
menuInstance.addEventListener("rollOut", listenerObject);
Usage 2:
on (rollOut) {
// Insert your code here.
}
Menu.rollOut
925
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers