Skip to main content
Known Participant
Dec 30, 2010 3:15 PM UTC
Question

Measuring Text in TFL

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 is closed to new replies. Start a new post to keep the conversation going.

3 replies

Adobe Employee
Jan 4, 2011 5:33 PM UTC

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

Translate
buabcoAuthor
Known Participant
Apr 5, 2011 1:12 PM UTC

Hi Robin,

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

Sebastian

Translate
Adobe Employee
Apr 5, 2011 3:53 PM UTC

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

- robin

Translate