20 Replies Latest reply on Oct 20, 2007 2:25 PM by kglad

    XML / TextField problem : Displaying escaped quotation marks

    stephan.k Level 1
      Dear Forum

      I am having problem displaying escaped quotation marks in a dynamic text field. I'm using flash 8. Actionscript 2.

      1) I am loading the text content from a database / php with XML. It looks like this (note the backslashes!):
      ------------------------------------------------------------------------------------------ ---------------------------------------------
      [...]
      <description><![CDATA[My sample description text conains \"quotation marks.\" ]]></description>
      [...]

      2) After successfully loading the XML, I am retrieving the XML Node value like this:
      ------------------------------------------------------------------------------------------ --------------------
      [...]
      descriptionTXT = String(xml.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue);
      [...]

      3) Then I fill in the text into the TextField on the Stage, which has been put there manually. The HTML button of the text field is on and all the necessary fonts are installed (punctuations, all latins and regular characters)
      ------------------------------------------------------------------------------------------ -------------------------------------------------
      _root.txt_description.html = true;
      _root.txt_description.htmlText = descriptionTXT ;

      4) BUT the text field displays the text just like the XML file WITH the backslashes:
      ------------------------------------------------------------------------------------------ -------------------
      My sample description text conains \"quotation marks.\"



      Any ideas / suggestions how I can properly display the quotation marks without the backslashes in flash 8? or do I first need to do something with the text in php?

      Thanks

      Stephan