<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="dc()" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#ED2727, #EDE2E2]" width="482" height="389"> <mx:Label text="Hello Word" color="#EBF4F6" fontSize="20" x="10" y="10"/> <mx:Script> <![CDATA[ internal function dc():void{ var arr:Array=new Array(); for(var i:Number=0;i<6;i++) { //给数组赋值 arr.push("元素"+i); } //绑定数据到list控件 dt1.dataProvider=arr; dt2.dataProvider=arr; //允许拖动 dt1.dragEnabled=true; //允许放入 dt2.dropEnabled=true; dt1.allowMultipleSelection=true; dt2.dropEnabled=true; } ]]> </mx:Script> <mx:Label x="134" y="21" text="测试数据" id="mydt"/> <mx:List x="54" y="69" id="dt1" width="116" height="252"></mx:List> <mx:List x="236" y="69" height="252" id="dt2"></mx:List> </mx:Application>