Skip to main content
Known Participant
October 1, 2010
Question

TextFlow Container Height question!

  • October 1, 2010
  • 1 reply
  • 856 views

Hi,

I'm trying to detect the container height when the textflow changes, so I can make my container resizable. I found the answer in one of the posts here at the forum.

My questions is why when the CompositionComplete Event is fired, the boundaries of the container initially has a very unreal height, for example 2500 and after tha another CompositionComplete is fired with a more real value, in my test 370 (for my text flow). This causes the container to "jump".

Is there any way to prevent this? I want the resize o be very smooth.

I found this example, it works!, and illustrates the same issue I have:

http://www.oscar-mejia.com/blog/post/tlf-resiable-textflow-container

Please help.

Thanks

This topic has been closed for replies.

1 reply

Adobe Employee
October 1, 2010

Unless everything is composed getContentBounds().height is an estimate.

To get the exact height you'll need to compose everything in the container.  There are a couple of ways to do that.  You can call textFlow.flowComposer.composeToPosition() to force all the text to compose.  Or you can pass NaN as the height to ContainerController.setCompositionSize but in this case you'll need to manage the scrolling yourself as TLF will assume the container is unbounded.  I'd go with the first option.

Hope that helps,

Richard

storm767Author
Known Participant
October 2, 2010

Thanks for your answer Richard. Problem is when the CompositionComplete event is fired, the  getContentBounds().height is incorrect. is not supposed to be totally composed when the event is fired the first time?

When the TextFlow is updated, this event is fired at least twice, some times three. How can I know when it's really completed?

Adobe Employee
October 5, 2010

TLF minimizes what's composed based on damage, measure settings (NaN comositionHeight), scrolling settings and what's in view. The goal is to present the user with the correct visual display of TextLines as quickly as possible.  Unless something is done (measuring or forcing full compose) the contentBounds height is going to be an estimate.

Regarding multiple composes - is that when typing?  I think the type ahead logic composes and then does the next operation.  Generally there is one compose per operation.

Richard