代码:

 

  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="450" height="350" creationComplete="initApp()" backgroundColor="#FFFFFF" fontSize="12">   
  3.     <mx:Script> 
  4.         <![CDATA[  
  5.             private function initApp():void{  
  6.                 words.dataProvider=['Water','水','Car','汽车','House','房屋','Book','书籍','Music','音乐','Sandwich','三明治'];  
  7.                 english.dataProvider=[];  
  8.                 chinese.dataProvider=[];  
  9.             }  
  10.         ]]> 
  11.     </mx:Script> 
  12.     <mx:Panel  width="450" height="350"  title="123451"> 
  13.         <mx:HBox width="100%" height="100%"> 
  14.             <mx:VBox height="100%" width="50%"> 
  15.                 <mx:Label text="拖拽"/> 
  16.                 <mx:List  id="words" width="200" height="275" allowMultipleSelection="true" dragEnabled="true"></mx:List> 
  17.             </mx:VBox> 
  18.              <mx:VBox height="100%" width="50%"> 
  19.                       <mx:Label  text="英文"/> 
  20.                       <mx:List  id="english" width="200" height="120" dropEnabled="true"></mx:List> 
  21.                       <mx:Label  text="中文"/> 
  22.                       <mx:List  id="chinese" width="200" height="120" dropEnabled="true"></mx:List> 
  23.             </mx:VBox> 
  24.         </mx:HBox>        
  25.     </mx:Panel> 
  26. </mx:Application> 

效果:

flex学习笔记 拖拽_flex 拖拽