3 Replies Latest reply on Jul 30, 2006 1:13 PM by leotemp

    Creating dynamic XML without String var ?

    PGzinho
      Hi all...

      I am trying to create a XML to use it in a DataGrid as a DataProvider... So far I was able to do it but only using a String variable, is there any othe way to do it? I found/think there is another way but i'm kinda lost on this subject... Here is how im doing it (more or less):

      private var dataPlaylist : XML;
      private var xml : String = new String();

      xml += ' <music>\n';
      xml += ' <artist>' + player.id3.artist + '</artist>\n';
      xml += ' <track>' + player.id3.songName + '</track>\n';
      xml += ' <title>' + player.id3.title + '</title>\n';
      xml += ' <album>' + player.id3.album + '</album>\n';
      xml += ' <time>' + player.length + '</time>\n';
      xml += ' </music>\n';

      dataPlaylist = XML(xml);
      playlist.dataProvider = dataPlaylist.musica;