HELP! Textfield resizing

Hello Guys,

I have a simple problem which i cant seem to solve.

I have a dynamic tf and it has a background. If the tf’s height is resized, the background will also resize it self.

tf.height = bg.height;

Im arranging the tf’s vertically with 2px spacing. My problem is with the spacing. If the tf’s height has been changed, the 2 px spacing is never preserved. Here’s my sample code:

var s:Strip = new Strip();
var ta:Array = new Array();

ta = [“aasdfasd”, “aasdfasd”, “aasdfaaaaaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaasd”];

for(var i:uint = 0; i < ta.length; i++)
{
s = new Strip();

s.tt.autoSize = TextFieldAutoSize.LEFT;
s.tt.text = ta*;
s.bg.height = s.tt.height + 10;
s.x = 35;
s.y = (s.bg.height +2) * i;

cont.addChild(s);

}

I want to arrange this textfields vertically and preserve the 2px spacing even if the height of the textfields are diff with each other.

Please HELP :slight_smile:

Thanks Guys!