【发布时间】:2014-07-08 07:50:43
【问题描述】:
我有一个使用 Flash CS6 和 Adobe AIR 制作的应用程序,它超过了 50Mb 的 Google Play 限制。所以我使用的是扩展文件,它是一个 .obb 文件,里面有几个我需要使用 as3 提取的 swf。扩展文件被下载到 /Android/obb/my_package_name/ 文件夹,我可以在下面的代码中找到它,但是在从 obb 文件中提取文件时卡住了。 使用 FZIP 类没有帮助(它提取 .zip 文件而不是 .obb)。以下是我的代码
file = File.userDirectory.resolvePath(path + "/" + filename);
if (file.exists)
{
loadSwf();
}
function loadSwf():void
{
fileStream = new FileStream();
fileStream.open(file, FileMode.READ);
bytes = new ByteArray();
fileStream.readBytes(bytes);
trace(bytes);
fileStream.close();
var cont:LoaderContext = new LoaderContext();
cont.allowCodeImport = true;
applicationLoader = new Loader();
applicationLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleAppLoaded);
applicationLoader.loadBytes(bytes, cont);
}
function handleAppLoaded(e:Event):void
{
addChild(applicationLoader);
/* Now how to extract the swf's from within the obb */
}
【问题讨论】:
-
*.obb是什么文件格式?我认为应该有办法从这样的 obb 导出 SWF,如果这是一个受支持的扩展,但我不知道。 -
OBB 文件扩展名与适用于智能手机和平板电脑的 Google Android 操作系统相关联。
标签: android actionscript-3 air expansion