我需要能够将外部配置文件加载到我的flex应用程序中.我已经读过,只要将mimeType设置为application/octet-stream,就可以使用embeds.
package learning {
import org.flixel.*;
public class PlayState extends FlxState {
[Embed(source = "../../data/tiles.png")] private var _tiles:Class;
[Embed(source = '../../data/map.txt', mimeType = "application/octet-stream")] private var ExternalMapData:Class;
public var txt:FlxText;
public var player:FlxSprite;
override public function create():void {
bgColor = 0xffaaaaaa;
super.create();
}
override public function update():void {
super.update();
}
}
}
Run Code Online (Sandbox Code Playgroud)
当我使用mxmlc它编译它时,它成功编译没有错误.当我运行SWF时,它会加载所有Flixel菜单然后挂起.
如果我注释掉该[Embed(source = '../../data/map.txt'行,它会编译并且不会挂起.
为什么这个嵌入导致冻结?
mxmlc的版本信息:
Adobe Flex Compiler (mxmlc)
Version 4.0.0 build 14159
Run Code Online (Sandbox Code Playgroud)
编辑
事实证明错误没有正确显示,但这是我从尝试嵌入时得到的:
VerifyError: Error #1014: Class mx.core::ByteArrayAsset could not be …