Convert html characters to text in Flash - AS3

I need to create an editable XML file to deliver content to a flash site.

I create my file with the html form and htmlspecialcharsfor example:

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

This is to prevent the writing of XML characters that lead to the error "XML parsing error: not correctly formed , for example

<entry title="Words & Things">
---------------------^

It has a side effect that the flash file file displays html codes for the content, and not the corresponding characters.

Is there a good way to convert codes back as soon as they are read into a Flash file (as3)?

+3
source share
2 answers

, :

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

( : http://www.razorberry.com/blog/archives/2007/11/02/converting-html-entities-in-as3/)

+2

Source: https://habr.com/ru/post/1707008/


All Articles