2 Replies Latest reply on Apr 16, 2012 4:51 AM by Harbs.

    How to Add a Linefeed to the Very End of a TextFrame's Contents

    mlavie Level 1

      (IND 5.0, Actionscript)


      Hi all,


      I need to be able to add a linefeed ("\n") to the very end of a TextFrame's contents, which may include any combination of tagged and untagged texts, and tagged and untagged image frames.


      There seems to be an endless variation of circumstances, each of which require a specific solution.


      For example:


      • If the last run of the Text is tagged, then I need to append the "\n" to the that last tag's contents.
      • If there are no Tags in the Text, then I can append the "\n" to the TextFrame's contents.
      • If the TextFrame is Tagged, but the last letter(s) in the Text are untagged - I don't know what to do.
      • If the last object in the TextFrame is an Image Frame, then I don't know what to do (you can't add the "\n" to an image's contents).


      In short, is there some catch-all solution for adding a "\n" at the very end of a TextFrame's contents, without the Tags on the Text being removed and without causing a failure due to trying to add "\n" to an Image's contents?