środa, 11 stycznia 2012

Flex Spark TextInput scroll and position coursor

Well ex. you want to browse for directory and then display results in to let end user modify it. These operations you can find easy in one place textDisplay property.

And the code:


xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
applicationComplete="windowedapplication1_applicationCompleteHandler(event)">

import mx.events.FlexEvent;

protected function windowedapplication1_applicationCompleteHandler(event:FlexEvent):void
{
var s:String = "myVeryVeryVeryLongString";
$myInput.text = s;
$myInput.setFocus();
$myInput.textDisplay.selectRange($myInput.text.length,$myInput.text.length);
$myInput.textDisplay.scrollToRange($myInput.text.length, $myInput.text.length);
}

]]>




hope that helps you can find also textDisplay in spark TextArea.

Brak komentarzy:

Prześlij komentarz