Calculating Text Width In ActionScript And Flex
Posted
by Joshua
on Stack Overflow
See other posts from Stack Overflow
or by Joshua
Published on 2010-05-26T21:20:47Z
Indexed on
2010/05/26
21:41 UTC
Read the original article
Hit count: 512
I'm trying to calculate how WIDE to make my button, based on the text that it will contain, and when I try to google for how to calcuate something as simplistic as the WIDTH OF SOME TEXT, I go cross-eyed just trying to wade through apparently nonsensical esoteric counter-intuitive voodoo. Can anyone out there help simplify for me how I would write a function like this:
public function HowWideWouldThisTextBeIfItWereInThisButton(Text:String,Container:Button):int {
...
}
Thanks in advance.
© Stack Overflow or respective owner