rottendevice
rottendevice

Reputation: 2879

Applying padding to a TextField in ActionScript 3.0

I'm trying to apply a padding to the top of my TextField instance in my Flash application, much like you would using CSS.

I haven't found any way to do this. You'd expect it to be a part of the TextFormat or StyleSheet classes, but it's in neither. I sort of found a workaround by adding htmlText to the top of the TextField with <br /><br /> in it, but adding entire lines of white space to the top isn't desirable.

Any ideas?

Upvotes: 0

Views: 640

Answers (1)

ezekielDFM
ezekielDFM

Reputation: 1977

The reason padding not included in the stylesheet classes is because it is part of the CSS Box Model. Flash doesn't use CSS for positioning or box model styling at all. It only uses css to style the text. Why not just set the Y position of the textfield down the amount of pixels you want to pad?

Upvotes: 2

Related Questions