I have an external xml named scratch.xspf :

<?xml version="1.0" encoding="UTF-8"?>
<playlist>
  <trackList>
    <track>
      <location>/songs/Led Zeppelin II/The Lemon Song.mp3</location>
      <creator>Led Zeppelin</creator>
      <album>Led Zeppelin II</album>
      <title>The Lemon Song</title>
      <image>/covers/Led Zeppelin II.jpg</image>
    </track>
    <track>
      <location>/songs/Led Zeppelin II/Whole Lotta Love.mp3</location>
      <creator>Led Zeppelin</creator>
      <album>Led Zeppelin II</album>
      <title>Whole Lotta Love</title>
      <image>/covers/Led Zeppelin II.jpg</image>
    </track>
  </trackList>
</playlist>


And I am trying to use it as such:

public function openList():void { 
                                 
var loader:URLLoader = new URLLoader(new
URLRequest("/playlists/scratch.xspf"));
var myXML:XML = new XML(loader.data);
                  
for (var i:int = 0; i < myXML.children().children().length(); i++){
     var location:String = String(playlist.trackList.track[i].location);
         var title:String = String(playlist.trackList.track[i].title);
         tempPlayingList.addItem({file_name:location,title:title})
                        
                 }
                }

This does not work. However if I copy the actual xml from the file
replacing "loader.data" it does work.
I cant't for the life of me figure out what is wrong.

Reply via email to