Scroll to TextLine
Hi there,
I have this list of pararaphs, that in my application stand for the start of a new page, I put these in a little combobox so the user can jump between pages in my app by selecting an item. (The whole TextFlow is in one container). By selecting an item, the specified paragraph then scrolls to the top of the container.
I thought this mechanism was easy enough to implement, like this:
var startPos:int = paragraphElement.getAbsoluteStart();
var tfl:TextFlowLine = textFlow.flowComposer.findLineAtPosition(position);
containerController.verticalScrollPosition = tfl.y;
Now, this works like a charm for the first couple of paragraphs, but later on the textflowline has a y property of 0.
I understand now that this is, of course, because these lines haven't been drawn yet.
So, obviously I'm using the wrong technique for this, therefore my question:
Is there a different way of scrolling an arbitrary paragraph in your textflow to the top of your container?
Any help will be greatly appreciated, thanks in advance!
cheers,
Roland
