没有返回结果在空气中的应用程序URL Loader类应用程序、结果、空气中、Loader

2023-09-08 15:09:39 作者:我是帅比我骄傲

我使用的是类的URLLoader在我的AIR应用程序,如果我在URL中使用的参数,弯曲显示错误#2032。如果用在Web应用程序相同的code,即在网页浏览器中运行,返回正确的结果。我没有得到妥善的解决办法呢。有什么方法返回的结果在我的AIR应用程序?我用了一个网络调试小提琴手,检查来自服务器的数据是否返回与否。数据被从服务器返回正确的,但它没有显示在空气中应用

下面是我使用的URL的方式 -

 的URLLoader =新的URLLoader(新的URLRequest(http://exaple.com?year=2012'));
 

解决方案 花小钱办大事 笔记本换SSD全过程分享

如果你付出了一些注意文档(谁做的呢?!),你会看到构造函数的 的URLLoader 需要的 的URLRequest

我一般使用URLLoader如下:

  VAR的URLRequest:的URLRequest =新的URLRequest(http://example.com?year=2012');
VAR的URLLoader:的URLLoader =新的URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.TEXT; // 默认
urlLoader.addEventListener(引发Event.COMPLETE,urlLoader_complete);
对URLLoader.load(的URLRequest);

功能urlLoader_complete(EVT:事件):无效{
    跟踪(urlLoader.data);
}
 

同时检查防火墙没有阻止你adl.exe过程。

I am using the class URLLoader in my air application and if i used parameters in url , flex showing an error #2032. if the same code used in web application, that is running in web browser, returning proper results. I didn't get a proper solution yet. Is there any way to return results in my air application? I used a web debugger fiddler, to check whether data is returning from server or not. Data is returning properly from the server, but it is not showing in air application.

here is the way i used the url-

urlLoader=new URLLoader(new URLRequest('http://exaple.com?year=2012'));

解决方案

If you paid some attention to the documentation ( who does that anyway?! ) you'd see that the constructor to URLLoader takes a URLRequest

I generally use the URLLoader as follows:

var urlRequest:URLRequest = new URLRequest('http://example.com?year=2012');
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.TEXT; // default
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.load(urlRequest);

function urlLoader_complete(evt:Event):void {   
    trace(urlLoader.data);
}

Also check that a firewall isn't blocking your adl.exe process.