Someone was asking how to set the focus indicator into the TextInput rather than just setting focus to a TextInput.
Here is a simple code snippet that demonstrates how to do this using the TextIput’s setSelection() method:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:TextInput id="ti"/>
<mx:Button label="Set Focus into TextInput" click="ti.setFocus();ti.setSelection(0,0)"/>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:TextInput id="ti"/>
<mx:Button label="Set Focus into TextInput" click="ti.setFocus();ti.setSelection(0,0)"/>
</mx:Application>





Recent Comments