lius  


 

 

 

 

 

As代码
  1.       
  2.     [Bindable]  
  3.             public var arrayCol:ArrayCollection;  
  4. public function Test():void  
  5.             {  
  6.                     
  7.                   
  8.                 //*  
  9.                   
  10.                 var webs:WebService=new WebService();  
  11.                 webs.wsdl="http://localhost/Web/WebService1.asmx?WSDL";  
  12.                 webs.loadWSDL();  
  13.                  webs.showBusyCursor=true;  
  14.                    
  15.                 // webs.addEventListener(LoadEvent.LOAD,load);  
  16.                  webs.addEventListener(ResultEvent.RESULT,WebsResult);  
  17.                   webs.addEventListener(FaultEvent.FAULT,webFault);  
  18.                    
  19.                 webs.GetProData();  
  20.            
  21.                   
  22.                 //*/  
  23.                
  24.                   
  25.             }  
  26.               
  27.             public function webFault(event:FaultEvent):void  
  28.             {  
  29.                 Alert.show(event.toString());  
  30.             }  
  31.               
  32.             public  function  WebsResult(Result:ResultEvent):void  
  33.             {  
  34.                  arrayCol =Result.result as ArrayCollection;  
  35.             }  
 
Mxml代码
  1. <mx:AdvancedDataGrid id="adg1"  
  2.                      designViewDataType="tree" editable="true"  
  3.                      dataProvider="{arrayCol}">  
  4.     <mx:columns>  
  5.         <mx:AdvancedDataGridColumn headerText="CustomerID"  
  6.                                    dataField="CustomerID"/>  
  7.         <mx:AdvancedDataGridColumn headerText="ShipName"  
  8.                editable="false"  
  9.                                    dataField="ShipName"/>  
  10.         <mx:AdvancedDataGridColumn headerText="Freight"  
  11.                                        itemEditor="mx.controls.NumericStepper"    
  12.                                    dataField="Freight"/>  
  13.     </mx:columns>  
  14. </mx:AdvancedDataGrid>  
  15.  <mx:Button  label="testWeb" click="Test()"></mx:Button> 
posted on 2009-03-30 11:12  sayno  阅读(456)  评论(0)    收藏  举报