Here is a simple application incorporating
your code snippet. As I click in the TextArea, I don't get any errors. So
you'll need to post your exact code and the exact sequence of user interactions
that lead to your problem. What is the value of caretIndex when you get the
error? - Gordon <?xml version="1.0"
encoding="utf-8"?> <mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ use
namespace mx_internal; private
function initializeHandler(event:Event):void { textArea.text
= "Line 1\nLine 2"; } private
function clickHandler(event:MouseEvent):void { var
caretIndex:int = textArea.getTextField().caretIndex; var
beginIndex:int = textArea.getTextField().getFirstCharInParagraph(caretIndex); var
endIndex:int = textArea.getTextField().getParagraphLength(caretIndex); trace(caretIndex,
beginIndex, endIndex); } ]]> </mx:Script> <mx:TextArea
id="textArea" initialize="initializeHandler(event)"
click="clickHandler(event)"/> </mx:Application> From: var caretIndex:int = textArea.getTextFie -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |