0 Replies Latest reply on Dec 9, 2010 12:58 PM by KatyCast87

    URGENT help needed with an xml external playlist. DESPERATE

    KatyCast87

      I was given an assignment to create and external video playlist using an xml file.  I have never used flash before, know nothing about encoding and all that was given to the class in terms of instuctions was a short tutorial that has no resources for troubleshooting.  We were given everything; the external playlist file equipped with the video skin, the video list, actionscript that loads the xml and the xml file.  We were told that all we need to do is change the names of the videos in the xml file to match the names of our videos.  I did that.  We were also told we needed to "name target", but we were not informed on how to do this.  I have tried everything, visited every tutorial and I cannot figure out how to get this damn thing to work.  I cannot even get flash to load the xml file. PLEASE HELP.

       

      Here is the xml file:

       

      <?xml version = "1.0" encoding = "i-8859-1"?>

       

      <playlist>
      <ADogWithoutABone
      flvurl="ADogWithoutABone.flv"
      desc="Hyper Wall First Video" />

       

      <Highway
      flvurl="Highway.flv"
      desc="Hyper Wall Second Video" />
      <PsychoBabble
      flvurl="PsychoBabble.flv"
      desc="Hyper Wall Third Video" />

       

      <SomethingElse
      flvurl="SomethingElse.flv"
      desc="Hyper Wall Fourth Video" />

       

      </playlist>

       

       

      I tried putting in the entire address of the file location, but it did nothing.

       

      Here is the actionscript in the flash file:

       

      var xmlLoader:URLLoader = new URLLoader();
      xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
      xmlLoader.load(new URLRequest("playlistXML.xml"));

       

      function xmlLoaded(event:Event):void {
      var playlistXML:XML = new XML(event.target.data);
      var item:XML;
      for each(item in playlistXML.videoname) {
      trace("item: "+item.attribute("flvurl").toXMLString());
      myPlayList.addItem({label:item.attribute("desc").toXMLString(), data:item.attribute("flvurl").toXMLString()});

       

      }

       

      //Select the first video
      myPlayList.selectedIndex = 0;
      //And automatically play it
      myPlayScreen.play(myPlayList.selectedItem.data);

       

      }

       

      //Add a listener to detect when new video is selected and play it
      function listListener(event:Event) {
      myPlayScreen.play(event.target.selectedItem.data);

       

      }

       

      myPlayList.addEventListener(Event.CHANGE, listListener);

       

       

      I tried placing the full address of the xml file in, along with the file address of the videos, but again it did nothing.  Everything is located in the same file, and the videos in a sub file in that file. I tried taking out the sub file and putting all the videos in the same file, but it did nothing.  I am sure it's something very simple, but like I said I have NO experience with this whatsoever. I am SO lost and DESPERATELY need help. PLEASE someone SAVE MEEEE!

       

      Thanks