This content has been marked as final. Show 2 replies
> Hi, is there a simple way to get rid of html tags present on
> a string?
You betcha. Just route the string with those tags to the TextField.text
property of your text field, rather than its TextField.htmlText property.
> What about special chars encoded? What I want to do is
> to change
> <p>Hi, this is a tagged html text with some special chars:
Ah, those are HTML entities, and Flash only supports very few of them.
Search "About supported HTML entities" in the documentation for the full
(very short) list.
> The formatting information, like the bold on text above, is
> not important to me. I just want the plain text with special
> chars converted.
HTML formatting is required to translate the few HTML entities
supported. If you drop the HTML formatting, you'll lose the formatting, but
you'll also lose the entity conversion. It would be tedious, but you would
have to loops through your string characters looking for HTML entities and
replace them one by one.
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."
A fairly painless solution to stripping out html tags is below. After you strip them out, you'll still need to take care of those special characters. You can do that with the prototypable method outlined here: