Padding left can be done by TextFormat.leftMargin.
And padding right can be done by TextFormat.rightMargin.
But there is no topMargin or bottomMargin property in TextField or TextFormat.
How can I do padding top and bottom?
Example code of left and right padding(margin) of TextField:
var format:TextFormat = new TextFormat
format.leftMargin = 40
format.rightMargin = 40
var text:TextField = new TextField
text.defaultTextFormat = format
text.background = true
text.backgroundColor = 0xeeaaaa
text.autoSize = TextFieldAutoSize.CENTER
text.text = 'abc'
Just increase the height of your sprite, text.height + 10 for example, and set text.y = 5 for a 5 pixel top and bottom margin