I don't think you can centre text in a TextField vertically - the x
property will be there because you can centre it horizontally.
There is a 2 pixel "gutter" around the text field, there may also be
horizontal margins:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextLineMetrics.html
Hope this helps.
Glen
Hudson Ansley wrote:
I realize that if TextLineMetrics had a "y" property as well as the
"x", that would do it for me, so I wonder why that was left off...
Regards,
Hudson
On Wed, Aug 26, 2009 at 4:39 PM, Hudson Ansley<[email protected]> wrote:
Anyone have a technique for centering a TextField vertically
(accurately)? other than converting to bitmap...
I can get the textHeight, but I don't know how to get the amount of
empty space between the top of the TextField and the actual text. This
varies with font, style, etc, and of course the characters in the
text. Looked at TextLineMetrics, afaict, it does not give a value for
the distance from the top of the field to the top of the text, and I
suppose I might be able to use getCharBoundaries, but then I'd have to
combine the results from all the characters, which seems a bit over
the top... also, must be Flash 9
Regards,
Hudson
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders