Android的空气忽略外部swf文件 [英] Air for android ignores external swf files

查看:167
本文介绍了Android的空气忽略外部swf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从应用程序目录
加载外部swfs的一些应用程序的问题是,一些swf文件得到正确加载和其他人给ioerror网址找不到



我把路径放在一个数组中,并使用一个加载器来加载路径

  var arr:Array = [Games /1.swf,Games / 2.swf]; 
var loader:Loader = new Loader();
loader.load(new URLRequest(arr [0]));

这仅仅是一个例子,加载所有文件是一样的,但是并不适用于所有的文件。
会是什么问题?首先,每当你加载一些东西时,听一下相应的错误事件,所以你知道是怎么回事:

  loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,ioErrorHandler); 
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityErrorHandler);

使用手机时,您应该使用 app:// 简写作为应用程序目录的引用(我假定它是你的 Game 文件夹的地方)。相对路径通常不起作用。



所以应该看起来像这样:

$ $ $ $ $ $ $ var arr:Array = [app://游戏/ 1.swf,app://Games/2.swf];

更多的信息/选项,你可以看看我对这个问题的回答


I am working on some app that loads external swfs from the application directory the problem is that some swf files get loaded correctly and others give ioerror url not found

i put the paths in an array and use a loader to load the path

var arr:Array = ["Games/1.swf", "Games/2.swf"];
var loader:Loader = new Loader();
loader.load(new URLRequest(arr[0]));

this is just example and it is the same in loading all the files but does not work on all files. what would be the problem?

解决方案

Firstly, whenever you load something, listen for the appropriate error events so you know what's going on:

loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

When using mobile, you should use the app:// shorthand as a reference to the application directory (which I assume is where your Game folder is. Relative paths do not usually work.

So it should look like this:

var arr:Array = ["app://Games/1.swf", "app://Games/2.swf"];

For more information/options, you can look at my answer to this question

这篇关于Android的空气忽略外部swf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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