里面调用Web服务的方法在动作脚本3.0脚本、里面、动作、方法

2023-09-09 21:42:50 作者:傻傻的妞、哥爱你

我需要调用内部的Web服务的方法,并传递给它它的参数,从动作脚本3.0 谁能帮助我PLZ?我搜索在互联网上发现一个柔性的解决方案,我不挠的工作,我用行动脚本3.0

I need to call a method inside web service and passing to it it's parameters from action script 3.0 can anyone help me plz? i searched all over the internet and found solutions with flex and i am not working with flex i am working with action script 3.0

推荐答案

我用的是这样的:

var request:URLRequest = new URLRequest();
request.url = 'http://example.org';

// If you're POSTing data:
request.method = URLRequestMethod.POST;
request.data = new URLVariables({ /* Your object */ });

var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES; // If you're using POST
try {
    loader.load(request);
} catch(error:Error) {
    // Handle error
}

trace(loader.data); // Result

文件:

http://livedocs.adobe.com/flex/ 2 / langref /闪光灯/ NET / URLRequest.html http://livedocs.adobe.com/flex/ 2 / langref /闪光灯/ NET / URLLoader.html http://livedocs.adobe.com/flex/2/langref/flash/net/URLRequest.html http://livedocs.adobe.com/flex/2/langref/flash/net/URLLoader.html