Laxmidi
Laxmidi

Reputation: 2684

Extending Flex3's Panel: Calculating Title's Width in Custom Component

Hi I'm extending the Flex 3 panel component. I need to figure out the width of the title's text. Because, title is a private variable in panel, I can't access it via title.width.

I know the font, fontsize (14), and length of the title (which will vary). Knowing this info is there a way to calculate how many pixels wide the title is?

Upvotes: 1

Views: 311

Answers (1)

user700284
user700284

Reputation: 13620

titleTextField is a protected property.You can use it to calculate the textwidth right.

Can you try this and let me know if it works?

measureText(titleTextField.text).width

Upvotes: 1

Related Questions