Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If all you want to do is insert a tab into your text when the user presses the tab key, there's a better way to do it (and I hope it will solve your undo issue at the same time).</p> <p>You'll have to access the TextArea's model - the <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/elements/TextFlow.html" rel="nofollow">TextFlow</a> object - and tinker with its configuration. The textflow <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/elements/Configuration.html" rel="nofollow">Configuration</a> class has a property called '<a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/elements/Configuration.html#manageTabKey" rel="nofollow">manageTabKey</a>' which defaults to 'false'. If you set it to 'true' it will do what I think you're trying to do for you, i.e. when the user hits the tab key, insert a tab character instead of putting the focus on the next focusable element.</p> <pre><code>var textFlow:TextFlow = taData.textFlow; var config:Configuration = Configuration(textFlow.configuration); config.manageTabKey = true; </code></pre> <p>The cast to Configuration is necessary, because textFlow.configuration returns an IConfiguration interface that has no setter method for manageTabKey.</p> <p>Additionally, you could even set the width of your tabs by using the '<a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/elements/FlowElement.html#tabStops" rel="nofollow">tabStops</a>' property.</p> <pre><code>textFlow.tabStops = "25 50 75 100"; </code></pre> <p><strong>EDIT:</strong> I just noticed that you set 'focusEnabled' to false. This will also no longer be necessary.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload