0

I am trying to create app with list of word and sound for every one of this word
XML

<bla>
   <list>
         <word>Hello</word>
         <audio>Hello.mp3</audio>
   </list>
   <list>
         <word>Bye</word>
         <audio>bye.mp3</audio>
   </list>
</bla>

SOURCE :

<s:navigationContent>
        <s:Button label="Listan" click="playSound();"/>
</s:navigationContent>

Script :

<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>

I have error here :

[Embed(source="assent/sounds/{data.audio}")]

Error message :

Unable to transcode {data.audio}.

What can I do to fix it :} Using Flash Builder 4.6

Falko
  • 17,076
  • 13
  • 60
  • 105

1 Answers1

0

Embed = compiler directive. Embed haven't any runtime abilities at all. You must embed all assets or load it dynamically...

Smolniy
  • 456
  • 3
  • 9