ZetMenu
From Openzet
Contents |
Introduction
ZetMenu considers Stage's size to dynamically align submenu's x position. This control extends Menu class.
Property
Usage
myMenu = ZetMenu.createMenu(parent:DisplayObjectContainer, mdp:Object, showRoot:Boolean);The listing above shows a static method to generate menus of ZetMenu. You can constitute a basic menu by passing a reference to a DisplayObjectContainer for parent paremeter, and provide MenuDataProvider(mdp) property's value.
myMenu.show(xShow:Number, yShow:Number)The listing above sets the offset used for menus created by createMenu() method.
Application Example
var point1:Point = new Point();
var myMenu:ZetMenu;
myMenu = ZetMenu.createMenu(panel, myZetMenuData, false);
myMenu.labelField="@label"
myMenu.addEventListener("itemClick", menuHandler);
myMenu.show(0, 0);
function menuHandler(event:MenuEvent):void {
Alert.show("Label: " + event.item.@label, "Clicked menu item");
}

