Hi there,

I am using an external XML file to define the content for a Text
component in Flex.  The xml file has HTML tags (e.g. <b> for bold).

When I assign the XML to the Text component's htmlText property, I get
unwanted extra line breaks around the HTML tags.

For example, here is the external XML file:

<text>
  This is the text with <b>html</b> tags
</text>

Then in actionscript I load the XML file and create the Text component

  // create the XML file loader
  var xmlLoader = new URLLoader();
  xmlLoader.load(new URLRequest(externalFilename));

  // create an XML object from the file contents
  var myxml:XML = new XML(xmlLoader.data);

  // make the Text component
  var mytext:Text = new Text();
  mytext.htmlText = myxml;

The displayed text component has three lines of text because of
unwanted line breaks around the HTML <b> tag:
  "This is the text with
  *html*
  tags"

Instead of just one line of text as I was hoping for:
  "This is the text with *html* tags"

Is there a way around this (perhaps a way to specify a set of tags
(e.g. <b>) that should not be interpreted as XML sub-nodes of <text>?

Thanks in advance

Reply via email to