0 Replies Latest reply on Oct 19, 2006 10:19 AM by cstormer

    How to get paragraph from TextArea component

    cstormer
      This is my code:

      var caretIndex:int = textArea.getTextField().caretIndex;
      var beginIndex:int =textArea.getTextField().getFirstCharInParagraph(caretIndex);
      var endIndex:int = textArea.getTextField().getParagraphLength(caretIndex);

      and I'm getting error like "The supplied index is out of bounds."

      And here is the deffinitoin of getParagraphLength property:

      getParagraphLength () method

      public function getParagraphLength(charIndex:int):int

      Parameters charIndex:int — The zero-based index value of the
      character (for example, the first character is 0, the second character
      is 1, and so on).

      Returns int — Returns the number of characters in the paragraph.

      Please tell me what is wrong with my code?