flex meun 使用
来源:互联网 发布:mysql exists 代替 in 编辑:程序博客网 时间:2024/05/24 06:18
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"layout="absolute"><mx:VBox><mx:Script><![CDATA[import mx.events.MenuEvent;import mx.controls.Alert;private function handleMenuClick(e:MenuEvent):void{switch (e.label){case "menu11":Alert.show("menu11");break;case "menu12":Alert.show("menu12");break;case "menu21":Alert("menu21");break;case "menu22":Alert.show("menu22");break;}}]]></mx:Script><mx:VBox x="0" y="0" width="100%" height="100%" verticalGap="0"><mx:HBox width="100%" height="50" id="title_box"><mx:Label text="menu test" fontSize="30"/></mx:HBox><mx:HBox width="100%" height="30" id="meun_box"><mx:MenuBar x="0"y="0"width="100%"height="100%"itemClick="handleMenuClick(event)"labelField="@label"fontStyle="normal"menuStyleName="#0267b5"><mx:XMLList id="menu_test"><menuitem label="menu1" fontSize="15"><menuitem label="menu11" fontSize="15"/><menuitem label="menu12" fontSize="15"/></menuitem><menuitem label="menu2" fontSize="15"><menuitem label="menu21" fontSize="15"/><menuitem label="menu22" fontSize="15"/></menuitem></mx:XMLList></mx:MenuBar></mx:HBox></mx:VBox></mx:VBox></mx:Application>