mxml:
1 <?xml version="1.0" encoding="utf-8"?> 2 <!--功能描述:Tree作为PopUpButton的弹出菜单--> 3 <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 4 xmlns:s="library://ns.adobe.com/flex/spark" 5 xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" 6 backgroundColor="black" viewSourceURL=""> 7 <fx:Declarations> 8 <!-- 将非可视元素(例如服务、值对象)放在此处 --> 9 <fx:XML id="data" xmlns=""> 10 <data> 11 <actor label="周星驰"> 12 <year label="1988"> 13 <item label="《霹雳先锋》香港票房8916612 " /> 14 <item label="《捕风汉子》香港票房3149395 " /> 15 <item label="《最佳女婿》香港票房5807710 " /> 16 </year> 17 <year label="1989"> 18 <item label="《龙在天涯》香港票房6809853 " /> 19 <item label="《义胆群英》香港票房7913329 " /> 20 <item label="《流氓差婆》香港票房5624622 " /> 21 <item label="《风雨同路》香港票房9335299 " /> 22 </year> 23 <year label="1990 "> 24 <item label="《望夫成龙》香港票房13703364 " /> 25 <item label="《咖喱辣椒》香港票房15777856 " /> 26 <item label="《小偷阿星》香港票房7968106 " /> 27 <item label="《师兄撞鬼》香港票房12128944 " /> 28 <item label="《赌圣》香港票房41326156 " /> 29 <item label="《无敌幸运星》香港票房18799869" /> 30 <item label="《江湖最后一个大佬》香港票房5495811 " /> 31 </year> 32 </actor> 33 <actor label="李连杰"> 34 <year label="1992"> 35 <item label="笑傲江湖之东方不败(1992)" /> 36 <item label="黄飞鸿之二男儿当自强(1992)" /> 37 <item label="黄飞鸿之三狮王争霸(1992)" /> 38 </year> 39 <year label="1993"> 40 <item label="方世玉Ⅱ万夫莫敌(1993)" /> 41 <item label="倚天屠龙记之魔教教主(1993)" /> 42 <item label="黄飞鸿之铁鸡斗蜈蚣(1993)" /> 43 <item label="太极张三丰(1993)" /> 44 </year> 45 <year label="1994"> 46 <item label="新少林五祖(1994)" /> 47 <item label="精武英雄(1994)" /> 48 <item label="中南海保镖(1994) " /> 49 <item label="给爸爸的信(1995" /> 50 </year> 51 <year label="1995"> 52 <item label="鼠胆龙威(1995)" /> 53 <item label="给爸爸的信(1995" /> 54 </year> 55 </actor> 56 </data> 57 </fx:XML> 58 </fx:Declarations> 59 <fx:Style> 60 @namespace s "library://ns.adobe.com/flex/spark"; 61 @namespace mx "library://ns.adobe.com/flex/mx"; 62 mx|Tree{ 63 textAlign: left; 64 fontWeight: normal; 65 } 66 </fx:Style> 67 <s:controlBarContent> 68 <mx:PopUpButton label="请选择..."> 69 <mx:popUp> 70 <mx:Tree id="tree" dataProvider="{data}" labelField="@label" showRoot="false" width="320" rowCount="8" /> 71 </mx:popUp> 72 </mx:PopUpButton> 73 </s:controlBarContent> 74 </s:Application>
时间: 2024-10-01 20:47:14