0 Replies Latest reply on Feb 21, 2012 4:40 AM by Micke@KGK

    Change URLRequest to a data binder

    Micke@KGK Level 1

      Hi.

       

      I want the soundloader to select the audiofile based on the info in an XML-file so I am trying to manipulate the code:

       

      var snd:Sound = new Sound();
      snd.load(new URLRequest("audio/world.mp3"));
      snd.play();

       

      in to say

       

      var snd:Sound = new Sound();
      snd.load(new URLRequest("{data.audio}"));
      snd.play();

       

      which doesn'ät work at all...

       

      since I want the code to locate the info from an xml-file that has the following tags for example:

       

      <track>
      <name>Arabian Nights</name>
      <number>001</number>
      <style>FullOn Psytrance</style>
      <length>32 seconds</length>
      <bpm>149 BPM</bpm>
      <image>profileimages/arabiannights.jpg</image>
      <audio>audio/world.mp3</audio>
      </track>

       

      All other info works fine loading name, number, style and so on. But how do I manipulate the code so I fethes the info on which file to play from the XML-file?

      Thank you!