Reputation: 353
textFormat.align = "center";
This, but a vertical equivalent please? Because of my experience with HTML I have tried
textFormat.valign = "middle";
But it does not work
Upvotes: 0
Views: 357
Reputation: 646
You can't align text vertically automatically in AS3.
You'll have to write your own function to do this.
eg.
public function verticalAlignTF(tf:TextField):void
{
tf.y += Math.round((tf.height - tf.textHeight) * .5);
}
Another option would be using TLFTextField
, which has a verticalAlign
property. Just note that TLF has been deprecated by Adobe, so you might run into some issues.
Upvotes: 1