0 Replies Latest reply on Jan 3, 2013 7:04 AM by mlavie

    How to Append Formatted Text to an XMLElement's Contents

    mlavie Level 1

      For CS5, Actionscript


      Hi All,


      I need to fill an XMLElement's contents property sequentially with several texts, each of which has its own different formatting (i.e., strikethrough, textDecoation, etc.).


      I tried sequential calls of:


      var myText:Text = myXmlElement.insertTextAsContent(contentString, XMLElementPosition.ELEMENT_END);


      The content from my variable contentString is successfully appened to the XMLElement's content (its single Text element in XMLElement.texts). However once I set a style property, such as strikeThrough, it continues to affect every additional content added via succesive calss to myXmlElement.insertTextAsContent(contentString, XMLElementPosition.ELEMENT_END);.


      My question: how do I make sure that styles such as myText.strikeThru will affect only the ext being appended for the current myText, and not any content added in successive calls?







      myText.strikeThru = myStrikethrough;