【发布时间】:2013-03-01 00:09:52
【问题描述】:
我在 Haxe 中播放声音资源时遇到问题。我可以使用swfmill 导入mp3 而不会出错:
<?xml version="1.0" encoding="utf-8" ?>
<movie width="100" height="100">
<frame>
<library>
... other resources ...
<sound id="Shoot" import="shoot.mp3"/>
</library>
</frame>
</movie>
在我的Main.hx 中,我创建了一个名为Shoot 的类,它以与我用于.png 资源的相同方式扩展Movieclip。然后我使用这个类如下:
var sound:MovieClip = new Shoot();
stage.addChild(sound);
sound.play();
但是在运行时,当执行这段代码时,我得到了错误
"Error #2136: The SWF File <project swf> contains invalid data".
我在我的 swf xml 文件或 haxe 代码中犯了什么明显的错误?如何进一步调试此错误?
【问题讨论】: