convert html characters back to text in Flash - AS3


I need to generate an editable xml file to supply content to a flash website.

I am generating my file with a html form, and htmlspecialchars e.g.:

    $currentItem = htmlspecialchars(stripslashes($currentItem));

This is to prevent xml entries which would produce the error "XML Parsing Error: not well-formed", such as

<entry title="Words & Things">

It has the side effect of making the flash file display the html codes for the content, rather than the proper characters.

Is there a good way to convert the codes back, once they are read into the Flash file (as3)?

4/23/2009 11:12:43 PM

Accepted Answer

Maybe try:

public function htmlUnescape(str:String):String
    return new XMLDocument(str).firstChild.nodeValue;

(Found at:

4/23/2009 11:25:01 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow