I am trying to figure out the best way to insert "text" in to
a textarea at the current caret position. Anyone have tips for
figuring out where to find this? In Flash you used to have
Im in the process of writing a code editor component, so
first off Im capturing the TAB key event, and then will insert an
actual TAB in the textarea... Right now I was just doing
this.Editor.text = this.Editor.text + ' '; But this is a stupid
stupid idea - so instead of appending it at the end, I need to
insert it in the current caret position.
Any tips would be greatly appreciated. Once I get it done, I
will be releasing it under either the Apache or GPL license.
Update: I have found
var text:String = this.Editor.text;
text.substr(0,this.Editor.selectionEndIndex) + " " +