# CDATA issue with HTML text

**URL:** https://forum.kirupa.com/t/cdata-issue-with-html-text/262451
**Category:** flash
**Created:** [June 6, 2008, 12:11am UTC](https://forum.kirupa.com/t/cdata-issue-with-html-text/262451 "2008-06-06T00:11:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bpdp](https://avatars.discourse-cdn.com/v4/letter/b/c0e974/32.png) [@bpdp](https://forum.kirupa.com/u/bpdp)
#### Post date: [June 6, 2008, 12:11am UTC](https://forum.kirupa.com/t/cdata-issue-with-html-text/262451/1 "2008-06-06T00:11:01Z")

</div>

Hello,  
I have an htmlTextField that I am loading html text from a xml doc. the problem is that the text is not rendering as html. so all my HTML is displayed in the textField.

here is the XML:

```auto

<description><![CDATA[<b>Recipe</b> for a tremendously ...]]></description>

```

here is the AS:

```auto

myDescription.htmlText = pageDescription[m];

```

but if i do this:

```auto

myDescription.htmlText = "<b>Recipe</b> for a tremendously ... ";

```

the html displays correct. so I know that the textField is setup to display the html. when I trace pageDescription I get:

```auto

&lt;b&gt;Recipe&lt;/b&gt; for a tremendously ...

```

I’m not sure how to fix this. Can anyone help me? thanks.

---

<div class="post-metadata">

### Author: ![frazzle](https://avatars.discourse-cdn.com/v4/letter/f/2bfe46/32.png) [@frazzle](https://forum.kirupa.com/u/frazzle)
#### Post date: [July 2, 2008, 1:27pm UTC](https://forum.kirupa.com/t/cdata-issue-with-html-text/262451/2 "2008-07-02T13:27:13Z")

</div>

This entirely depends on what is contained in pageDescription[m]

Make sure you set it to the \*nodeValue \*and not just the node…

for(var i:Number = 0; i \< myXML.length; i++) {  
pageDescription\* = myXML.childNodes\*.firstChild. **nodeValue** ;  
}

---

<div class="post-metadata">

### Author: ![btibia](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/btibia/32/1625_2.png) [@btibia](https://forum.kirupa.com/u/btibia)
#### Post date: [July 2, 2008, 1:40pm UTC](https://forum.kirupa.com/t/cdata-issue-with-html-text/262451/3 "2008-07-02T13:40:27Z")

</div>

plus you need to say to your textfield:

```auto

myDescription.html = true;

```

Second - textfield in flash 8 (as2) was little buggy ☹ i always had problems with it.  
Final - you need to embed the font.

btibia out:thumb2:
