文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>How to use Flex WebService Component in Flash

How to use Flex WebService Component in Flash

时间:2011-05-14  来源:Morris

1.) Prepare done the Flex SDK

2.) Import rpc.swc / Frameworks.swc into Flash

3.) Drag a DataGrid component into stage ( Instance Name : myDG )

4.) Use the following Sample Code

import mx.rpc.soap.*; 
import mx.core.*; 
import mx.rpc.events.*; 
import fl.data.DataProvider; 
  
var foo:WebService = new WebService(); 
  
foo.addEventListener( "load", loadDone); 
  
foo.loadWSDL( "http://www.webservicex.net/country.asmx?WSDL" ); 
  
var myOperation:Operation; 
  
function loadDone(evt:LoadEvent) 
{ 
  myOperation = Operation( foo.getOperation("GetCountries") ); 
   
  myOperation.addEventListener( "fault", wsError ); 
  myOperation.addEventListener( "result", wsResult ); 
   
  myOperation.send(); 
} 
  
function wsError(evt:FaultEvent) 
{ 
  trace(evt); 
} 
  
function wsResult(evt:ResultEvent) 
{ 
  var xml:XML = XML(evt.result); 
  var dp:DataProvider = new DataProvider(xml); 
  myDG.dataProvider = dp; 
}
相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载