flex meun 使用
发布时间:2020-12-15 05:08:25 所属栏目:百科 来源:网络整理
导读:?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"layout="absolute"mx:VBoxmx:Script![CDATA[import mx.events.MenuEvent;import mx.controls.Alert;private function handleMenuClick(e:MenuEvent):void{swi
<?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> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |