问题
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.
Thanks.
回答1:
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.
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());
}
}
You can embed pretty much any kind of file.
来源:https://stackoverflow.com/questions/9898117/including-external-assets-to-the-apk