1 Reply Latest reply on Apr 27, 2010 7:37 AM by KidTroopa

    Html displayed within List component As2

    KidTroopa Level 1

      Yet another simple project I'm trying to

      do to familiarize myself with flash.   I'm loading an external XML document into a Flash AS2 project using the XMLComponent.  I'm able to get everything to display properly within my lists except for my hyperlinks.

       

      I've enclosed my hyperlinks in the XML document using the <![CDATA[hyperlink]]>.    Once the movie launches.....the full URL tags are being displayed: (eg.  <a href="http://www.google.com">Google</a> )

       

      My hyperlinks are in there own seperate List component.  Any and all suggestions/hints would be greatly appreciated.

       

      Troop

      (Flash & Flex newbie)

        • 1. Re: Html displayed within List component As2
          KidTroopa Level 1

          Okay...based on the following posting:  http://forums.digitalpoint.com/showthread.php?t=689192    (Credit to WASSIM)

          I was able to accomplish my goal.

           

          I removed the CDATA tags and restructured my hyperlink nodes as such:

           

          <link name="Google">

                  <website>http://www.google.com</website>

          </link>

           

           

           

          Within the List Component binding.....I set a formatter:   label='<name>';url='<website>';data=link; 

          With this....the only thing displayed in the list is the Name....and the url variable is defined.....otherwise...when I clicked on the list item..I would get an undefined error...file not found.

           

           

          Final code:

          =============================

          var listener:Object = new Object();
          listener.change = function(evt) {
          getURL(evt.target.selectedItem.url);
          };


          myList.addEventListener("change",listener);

          =============================

           

          The code is reusable for multiple lists that contain hyperlinks.....just add event listeners for each additional list.