1 person found this helpful
Use a fixed width font?
Thank You for the answer.
But Is there any other way.
Actually we tried on change event of textarea to count characters typed in or removed and on reaching 90 characters we were appending line feed or new line to move the the next characters to next line. What we observed is we were able to get the count and all correctly but were not able to force the cursor to next line on reaching 90 characters. Is there any way for forcing the cursor to next line.
I am attaching the code block here
private function textArea_change(evt:Event):void
var nLineChars:uint=textArea.mx_internal::getTextField().getLineLength(nLines - 1);
if (nLineChars > 90)
You can use the spark.components.textArea that does what you wanna do automatically
Let me know if it works
In your solution if your are seeing \n in the text which you want to move to next line try using escape characters or ASCII value of new line. Let me know if this helps.
I think the best way is to have fixed width assigned to textarea to support number of chars with wrap enabled.
Is there any way for forcing the cursor to next line. ?!?!?!