AS dyn text pixel width?
AS dyn text pixel width?
- Started
- Last post
- 3 Responses
- wade
Do the dynamic text boxes in Flash have a AS property to get its width in pixels?
I'm creating a movie clip that resizes based on how much text it contains and the "length" property is a little unreliable being that 'l' or 'A' have a different pixel width but the same character length.
- jkosoy0
textField.autoSize = true;
...
- wade0
Yes, thanks. I'm still having an issue with the text box going off-center. Why is this?
Code:
bar.title.text = "Hello.";
bar.title.autoSize = true;if (bar.title.text.length >= 15) {
bar.box._width += 10;
bar.right._x += 5;
bar.left._x -= 5;
} else if (bar.title.text.length < 7) {
bar.box._width -= 40;
bar.right._x -= 20;
bar.left._x += 20;
}
- wade0
Got it figured. Thanks for the help!