包括外部资产的APK [英] Including External Assets to the APK
本文介绍了包括外部资产的APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是FlashDevelop 4.0.1 RTM创建一个简单的Android应用程序,我想问一下如何将外部资源(图片,XML和放大器,声音定位的bin文件夹中)的APK包
I am using FlashDevelop 4.0.1 RTM to create a simple Android app and I would like to ask how to include external assets (images, xml & sounds located inside the bin folder) to the apk package.
感谢。
推荐答案
据我看到的,您不需要对外资产以实际外部,它们可以嵌入,因为反正你希望他们嵌入到APK。
As far as I see, you don't need the external assets to be actually external, they can be embedded, since anyway you want them embedded into the apk.
因此,只要将其嵌入到您的SWF。取而代之的bin文件夹中加载的资产,做到这一点:
So just embed them into your swf. Instead of loading assets from the bin folder, do this:
public class YourClass {
// Embed the asset
[Embed(source='assets/yourImage.jpg')] private var yourImageClass:Class;
// ...
// Use the asset
private function someFunction():void {
var yourImage:DisplayObject = DisplayObject(new yourImageClass());
}
}
您可以嵌入pretty的太多任何类型的文件。
You can embed pretty much any kind of file.
这篇关于包括外部资产的APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文