Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 URLLoader不适用于Android的flex 4.6移动项目_Actionscript 3_Apache Flex_Flash Builder_Picasa - Fatal编程技术网

Actionscript 3 URLLoader不适用于Android的flex 4.6移动项目

Actionscript 3 URLLoader不适用于Android的flex 4.6移动项目,actionscript-3,apache-flex,flash-builder,picasa,Actionscript 3,Apache Flex,Flash Builder,Picasa,URLLoader未在Android Mobile上调度Event.COMPLETE事件,尽管它在Flash Builder Mobile调试中工作正常。下面给出了代码片段: private function loadAlbumData():void { var request:URLRequest = new URLRequest("https://picasaweb.google.com/data/feed/api/user/default"); var urlloader:URL

URLLoader未在Android Mobile上调度Event.COMPLETE事件,尽管它在Flash Builder Mobile调试中工作正常。下面给出了代码片段:

private function loadAlbumData():void
{
 var request:URLRequest = new URLRequest("https://picasaweb.google.com/data/feed/api/user/default");
    var urlloader:URLLoader = new URLLoader();
  urlloader.addEventListener(Event.COMPLETE, onLoadComplete);
  urlloader.load(request); 

}

private function onLoadComplete(evt:Event):void
{

   trace(evt.currentTarget.data);
}

这里我向谷歌的Picasa服务请求一个相册XML。

从XML页面的外观来看,它正在提取与我相关的数据。最好的猜测是,它依赖于登录谷歌来确定用户是谁。如果用户没有Google cookie(通过注销Google进行测试),它将返回“需要授权”,这可能会作为HTTP状态错误而不是实际页面返回。因为应用程序是沙盒的,所以在没有明确要求的情况下,应用程序之间甚至系统之间都不会共享cookie(这可能需要一个ANE)

在这种情况下,您有两个选项:

  • 了解如何允许用户登录Google,保存cookie并在请求中发送。我从来没有在Flash中处理过饼干,所以我无法在这里帮助你
  • 使用
    https://picasaweb.google.com/data/feed/api/user/USERNAMEHERE
    其中username此处是要从中提取数据的帐户的用户名

  • 显然,解决方案取决于此功能的实现,因此我不推荐使用哪种功能。但这绝对是你的问题。

    倾听错误事件,看看它们告诉你什么:
    SecurityErrorEvent.SECURITY\u error
    HTTPStatusEvent.HTTP\u STATUS
    IOErrorEvent.IO\u error
    @RIAstar u-right。它抛出IOErrorEvent.IO_错误。跟踪显示“[IOErrorEvent type=“ioError”bubbles=false cancelable=false eventPhase=2 text=“Error#2032:Stream Error.URL:“errorID=2032]”1。我可以登录谷歌并获得授权令牌,但使用该令牌我无法获得用户的相册XML,这将需要获得相册ID才能从特定相册中获取照片。因此,正如您所看到的,“登录”不是这里的问题。2. <代码>https://picasaweb.google.com/data/feed/api/user/USERNAMEHERE问题在于,使用此链接,我只能获取公共相册,而不能获取私人相册。