Monday, April 20, 2009

M is for Menus

The Flex Menu control creates pop-up menus of individually selectable choices, that can have cascading sub-menus. (Similar to the application menus (e.g. File, Edit) or right-click menus in most application.)

A Menu is created with a call to the Menu class static createMenu() function. Of course you'll have to pass some data representing the menu items and structure to the createMenu() call.

   // create the menu data structure
var menuData:Array = [ "Item 1", "Item 2", "Item 3" ];

// create the menu
var menu:Menu = Menu.createMenu( parent, menuData, false );

// show the menu
menu.show()

Learn more about Menus in Flex at Flex After Dark...

No comments:

Post a Comment