• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

htmlText not working on TextField in a Class

New Here ,
Mar 24, 2009 Mar 24, 2009

Copy link to clipboard

Copied

I have a simple class which contains a TextField. The textfield is populated with data from an XML file.

i am using the code:

txtField.htmlText = xmlElement.node.node.text();
txtField.setTextFormat(txtFmt);

If i don't use any HTML tags, it displays fine. But if I add tags, such as <a> or <b>, etc... the text within the tags does not display. For example, if in the XML text i have:

<node>For more information, <a href=' http://www.link.com'>Click Here</a> to see the information.
When I run the flash move, it displays:
For more informationto see the information.

If i remove the <a> tags, it displays fine.
Thanks
TOPICS
ActionScript

Views

344

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 24, 2009 Mar 24, 2009

Copy link to clipboard

Copied

You could wrap your html in CDATA tags

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 24, 2009 Mar 24, 2009

Copy link to clipboard

Copied

Either write it in the xml as:

<node><![CDATA[<a href=' http://www.link.com'>Click Here</a> to see the information.]]></node>

or as:

<node>&lt;a href=' http://www.link.com'&gt;Click Here&lt;/a&gt; to see the information.</node>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2009 Mar 25, 2009

Copy link to clipboard

Copied

LATEST
Thanks for replying - CDATA works perfect.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines