Skip to main content
Known Participant
February 11, 2009
Answered

Tab Key Usage

  • February 11, 2009
  • 3 replies
  • 7054 views
Tab stops are included in TLF but while editing text if the tab key is pressed it executes the default Flex action of switching to the next component. I tried searching for a attribute so I could use the tab key in the way a normal text editor does but I couldn't find anything. Are we expected to have to capture the tab key input and insert the tab value ourselves?
This topic has been closed for replies.
Correct answer brian_thomas2
This is a configuration option; by default it is set to allow Flash Player/AIR handle the tab key, but you can change this to allow TLF to handle the tab key instead.

Look at manageTabKey in the API docs: flashx.textLayout.elements.Configuration

3 replies

Inspiring
July 1, 2009

I'm afraid this isn't working for me either. Build 460. I'm working with the AIR SDK in Flex 4 beta 1. Tab causes a new-line to appear (not a tab) in the TextFlow and then the focusManager kicks in, tabbing to the next Flex control.

Adobe Employee
July 2, 2009

Hi,

The default behavior when there are no tab stops before the end of the line is to create a new line exactly as you describe.  Please verify that you've specified tab stops.

This is even simpler than the above.

textFlow.tabStops="tabStops="s100 s200"

will create tabs at 100 and 200 pixels.

Regards,

Richard

Inspiring
July 2, 2009

Thanks once again, I was confusing myself with the TabStopsFormat.defaultFormat, thinking that would supply some, it works perfectly when I use the formatted string you provide.

Adobe Employee
February 23, 2009
For the tab issue use TabStopFormat instead of TabStop. TabStopFormat provides type checking and input validation services that are consistent with the rest of the TLF styles.
brian_thomas2
Adobe Employee
brian_thomas2Correct answer
Adobe Employee
February 11, 2009
This is a configuration option; by default it is set to allow Flash Player/AIR handle the tab key, but you can change this to allow TLF to handle the tab key instead.

Look at manageTabKey in the API docs: flashx.textLayout.elements.Configuration
Known Participant
February 23, 2009
I did this and it inserted the TLF tab into the markup but it still switched the focus to the next component in the tab list. Is this a defect?

Also, I tried to add it tab stops to the text flow and it just ignores them and tabs to the end of the line. Am I missing something?

Configuration(textFlow.configuration).manageTabKey = true;
textFlow.tabStops = [new TabStop(TabAlignment.START, 20)]