Here's a solution with a small custom TextArea class, there are comments to explain a little more.
package { import mx.events.FlexEvent; import spark.components.TextArea; import spark.components.supportClasses.StyleableStageText; import spark.events.TextOperationEvent; public class CustomTextArea extends TextArea { private var _lineNumber:int = 1; private var _padding:int; private var _minHeight:int; public function CustomTextArea() { super(); addEventListener(FlexEvent.CREATION_COMPLETE, function setBehaviour(event:FlexEvent):void {
Hope this helps.
EDIT: With a lot of lines, the height of the TextArea increases too much. It must be.
jpicard
source share