Tabs in Flash Textfield
19 Mar 2005I want to know if there is any way to use TAB key within a text This is just logic and there is whole big room for improvement and all best practices :) Code beautifier never works because I have not fixed it yet ;)
field, in Actionscript. I want four space characters to be inserted
inside a text field, whenever a user presses "TAB" button, instead of
selecting the object with next tab index. Can anyone tell me if and
how it is possible?
This question was asked on IndiaMMUG list. I found a quick & dirty solution for this. Yeah, it's achieved using a button and on(keyPress "
Here is my answer:
1) Keep a button in offstage area
2) Put the following code on the button:</p>
on(keyPress "
It might have many bugs, I have not tested it...
Above code works on the cost of *NO* Tabbing in flash movie, which means pressing Tab won't shift focus to different object(movieclip, button, components etc). But I am sure, that can be achieved with more code and better logic. Probably attaching/removing code when Textfield gets/looses focus...
You can: