menu = new Menu;
menu.load("main");
menu.setMenu();
When a menu item in the main menu is clicked, the "onCommand" event fires.
menu = new Menu;
menu.load("main");
menu.setMenu();
menu.onCommand = function (id)
{
if (id == "new")
{
// do something
}
}
SWFKit will pass the identifier of the menu item to the event handler. So you must assign an unique identifier for each menu item, or you cannot distinguish which one is clicked.
The menu items can have shortcuts, you can set the "enableAccel" property of the menu object to true to enable the shortcuts.