Textarea and TAB Key


Does anyone know of a way to make the TAB key function as it would in a text editor instead of as a navigation control in a flash movie?

I have a V2 textarea component I would like to act as an HTML code editing tool. Any time someone goes to tab in their code for cosmetic reasons, it jumps to the next tabbable component.

Things I’ve tried:

  1. Making the textarea the only tabbable component using tabEnabled = true / tabEnabled = false on all components; as well as setting the tabindex on the textarea to 1 while all others are blank (almost works – but the textarea loses focus and you can’t detect where the carat was)

  2. Catching the keydown event using Key.TAB (almost works – again, the textarea loses focus and you no longer know where to put the TAB)

Any suggestions / solutions would be greatly appreciated.

  • Regards

on(keyPress "<Tab>"){
	textArea.text += "	";

havent you tried this?

That only concatenates the textarea. I want the “tab” character to be inserted wherever the carat happens to be located.