Skip to main content
Known Participant
December 30, 2010
Question

Measuring Text in TFL

  • December 30, 2010
  • 1 reply
  • 743 views

Hello,

I've got a simple problem but haven't been able to fix it jet so hope you people form TFL will help me. I'm seting up a RichTextEditor component inside a BorderContainer so I can display richText with all its features on a special tooltip that pops up when I pass the mouse over a component.


The thing is that before I popUp the element with the popup manager I have to setup the richText in it, and then I have to setup the size of the BorderContainer so all the text gets displayed with no wrapping or clipping.

I tried to use the measuring porperties of the RichTextEditor but this properties are set on the measuring pass that at the same time happens some frames later that the popupManager actually puts the element on screen so I don't get the right size.

I haven been able to find a function to get a TextLineMetrics objecto or some other element for measuring ether, so wich is the right way to go here?

thanks

Sebastian

This topic has been closed for replies.

1 reply

Adobe Employee
January 4, 2011

I'm not too familiar with Flex, but I think you can force the measuring to happen sooner by calling validateNow(). So you should be able to validate, and then ask for the size, and then set the border size. Can you try that?

- robin

buabcoAuthor
Known Participant
April 5, 2011

Hi Robin,

The validateNow() function doesn't work... I've never been able to make it work

Sebastian

Adobe Employee
April 5, 2011

I would suggest reposting your question on the Flex forum, they will be more likely to be able to help.

- robin