没有返回结果在空气中的应用程序URL Loader类 [英] URL Loader class in Air application not returning results

查看:100
本文介绍了没有返回结果在空气中的应用程序URL Loader类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

解决方案

如果你付出了一些注意<一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html#URLLoader%28%29"相对=nofollow>文档(谁做的呢?!),你会看到构造函数的 的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.

这篇关于没有返回结果在空气中的应用程序URL Loader类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆