How to tell SPARK scroll bar in TextArea to recalculate?

I have problem with vertical scroll in SPARK text area. I've added simple code in creation complete to insert 200 lines in text area:

private function creationCompleteHandler(event:FlexEvent):void
{
  for (var iind:uint = 1; iind < 200; iind++)
  {
    testTextArea.text += iind.toString() + "\n";
  }
}

And when I start application I noticed that the last 10% (approximately) of scroll bar is "a free walk". When scroll is on 90% page is scrolled all the way down, and when I move thumb of the scroll bar in last 10% of scroll bar nothing moves.

This is all until I change text in text area in browser, then scroll bar acts normal.

Thanks

edit: I tried to dispatch event "change", but it's still not working.

Answers


Try below, though it doesn't make much sense, at creationComplete block:

testTextArea.scroller.verticalScrollBar.value =    testTextArea.scroller.verticalScrollBar.maximum;
testTextArea.validateNow();
testTextArea.scroller.verticalScrollBar.value = 0;

Then when you listen:

testTextArea.scroller.verticalScrollBar.addEventListener(Event.CHANGE, on Change);

You can do whatever you want with:

if(testTextArea.scroller.verticalScrollBar.value >= (testTextArea.scroller.verticalScrollBar.maximum-5))

This certainly looks hacky!


Need Your Help

Mouse Event BHO

c++ visual-studio-2005 atl mouseevent bho

I want my BHO to listen to onmousedown event of some element in a certain webpage.