Air 应用程序中的 URL Loader 类不返回结果 [英] URL Loader class in Air application not returning results

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

问题描述

我在我的 air 应用程序中使用类 URLLoader,如果我在 url 中使用参数,flex 会显示错误 #2032.如果在 Web 应用程序中使用相同的代码,即在 Web 浏览器中运行,则返回正确的结果.我还没有得到合适的解决方案.有什么办法可以在我的空气应用程序中返回结果吗?我使用了 Web 调试器提琴手来检查数据是否从服务器返回.数据从服务器正确返回,但未在空中应用中显示.

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'));

推荐答案

如果您对 文档(到底是谁做的?!)你会看到 URLLoader 需要一个 URLRequest

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

我一般使用 URLLoader 如下:

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);
}

还要检查防火墙是否阻止了您的 adl.exe 进程.

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

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

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