2 Replies Latest reply on Jul 6, 2007 3:24 AM by Dave.Hollings

    XML formating

    Dave.Hollings Level 1
      Hi all,

      I have been trying to format my XML data when it loads into a flash text area component. The component is set to render text as HTML and I have applied global styles that I want. However everytime I run my app the XML data has not been formated corrected based on the styles I wanted. I have tried creating a css for the XML data however this did not work (not sure if I done this correctly though), I have also tried hard coding within the XML data <font face="Tahoma" size="11" color="0x666666"> TEXT </font> however this just stoped my data coming through totally. I have included a small extract of my XML data so you can see how it is set up:

      Any help would be greatly appreciated.

      <?xml version="1.0" encoding="utf-8" ?>
      <prospecVRfaq lastupdate="05-July-2007">
      <issue question="Am I eligible for technical support?" data="eligible" vidcontentid="">
      <desc><![CDATA[Yes, - every user of ProSpec VR is eligible for technical support. It is advisable to consult the FAQs before contacting the ProSpec Support Team as the FAQs will provide advise in 80% of cases. These FAQs have been written to help all our users as efficiently as possible. If you have any further questions or comments please contact the <font color="#0000ff"><a href="[link to content]" target="_blank">ProSpec Support Team</font></a>]]>
        • 1. Re: XML formating
          textFields that render as html tend to add things and modify what you put in them a bit... try tracing htmlText after you apply the xml string to it and see what changes happen if any.

          it drove me almost mad when I tried to make an input textfield have a different point size, and every time I put an empty string in it, even if formatted in a bit of html tags that it otherwise added, it reverted to the original point size.. so in the end i put a space instead of an empty string.. and added an onChanged event that removed that first space..

          so yes, it has a mind of it's own..
          • 2. Re: XML formating
            Dave.Hollings Level 1

            Just in case others are having the same problem I have managed to work out a solution, and though I would post it so it is available in the future:

            When populating the text area with the XML content you are pulling through in my case I wanted the <desc> within the XML to be inserted to the text area component labled answer_txt, based on a question the user selects.

            Because the text area is set to render test as HTML all I need to do was:

            answer_txt.text+="<font face='Tahoma' size='11' color=#666666'>+ [variable holding the xml data you require]";