I am populating a textfield programmatically and scrolling to the maxScrollH as the new text is added so the user can see the progression of text. This works fine, until I click the TextField, which sets scrollH back to 0 and places the caret in the text at the equivalent position.
textField.setSelection( text.length, text.length ); //sets the caretIndex/selection to the end
textField.scrollH = textField.maxScrollH; //scrolls to max
this is the code that I am using to scroll when the textField text property is updated. I've tried adding a listener to the click event on the textField, which works in a way, but causes a visible jump.
override protected function createChildren() : void
{
super.createChildren();
textField.addEventListener(MouseEvent.CLICK, handleTextFieldClick, false, 0, true);
}
protected function handleTextFieldClick(event:MouseEvent):void
{
textField.scrollH = currentTextFieldScrollPosition; //stored scrollH value
trace(textField.scrollH);
}
My guess is that there is a scroll position being calculated or stored someplace that I can't find.