我正在尝试为每个单词
XML创建带有单词和声音列表的应用程序
<bla>
<list>
<word>Hello</word>
<audio>Hello.mp3</audio>
</list>
<list>
<word>Bye</word>
<audio>bye.mp3</audio>
</list>
</bla>
资源 :
<s:navigationContent>
<s:Button label="Listan" click="playSound();"/>
</s:navigationContent>
脚本 :
<fx:Script>
<![CDATA[
import flash.media.*;
[Embed(source="assent/sounds/{data.audio}")]
[Bindable]
public var sndCls:Class;
public var snd:Sound = new sndCls() as Sound;
public var sndChannel:SoundChannel;
public function playSound():void {
sndChannel=snd.play();
}
public function stopSound():void {
sndChannel.stop();
}
]]>
</fx:Script>
我这里有错误:
[Embed(source="assent/sounds/{data.audio}")]
错误信息 :
Unable to transcode {data.audio}.
我能做些什么来修复它:} 使用 Flash Builder 4.6