ZetTextArea provides automatic line numbers as you write texts in TextArea.
The following is the basic usage.
<mx:Panel width="400" height="300">
<vf:ZetTextArea width="100%" height="100%"/>
</mx:Panel>