1 Reply Latest reply on Jun 14, 2009 8:29 PM by kglad

    Confused by simple HTML/formatting in XML problem.

    EverLightMusic Level 1

      Hey guys, thanks for all your help recently, my project is really coming along. However, I've hit another snag.

       

      I'm currently using a dynamic text box to pull text from an xml document which is very simply set up at the moment, the actionscript for this text box goes as follows:

       

      //init TextArea component
      newsText.html = true;
      newsText.wordWrap = true;
      newsText.multiline = true;
      newsText.label.condenseWhite=true;
      //load in XML
      newsContent = new XML();
      newsContent.ignoreWhite = true;
      newsContent.load("news.xml");
      newsContent.onLoad = function(success){
              if(success)
              {
                      newsText.text = newsContent;
              }
      }

       

      This is really basic, i just type plain text into the xml file and it'll pop up in the flash file.

      Now I'm a complete newbie when it comes to actionscript, but I know that it is possible to use some basic HTML tags in the XML document which will then render in the flash file. The things I want to do are embed images into the textbox and create text links. However, I have no idea how to do this, or where to start, and I've been having trouble understanding all of the various other threads on the internet about this exact same thing.

       

      Could somebody explain how I can do this in laymans terms? How can i get started using HTML tags in this XML document?

      Or maybe there is another way I can format my content which includes the ability to link and embed images?

       

      Thanks for your patience,  I'd still be sitting in front of a blank screen if it weren't for you guys!

       

       

      EDIT:


      I've been playing around with this tutorial: http://www.weblenium.com/2009/05/reading-html-tags-from-xml-into-flash/ and i have been able to get some basic HTML functionality out of it such as basic formatting, but whenever I insert an anchor or image tag, even within the CDATA area, the enire text box breaks and nothing is displayed after the point at which the offending tag is entered, everything before that is visible. Why is this? I know these tags are supported so what am i doing wrong?