# HELP! Textfield resizing

**URL:** https://forum.kirupa.com/t/help-textfield-resizing/281923
**Category:** flash
**Created:** [February 15, 2009, 11:29am UTC](https://forum.kirupa.com/t/help-textfield-resizing/281923 "2009-02-15T11:29:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nico](https://avatars.discourse-cdn.com/v4/letter/n/b5a626/32.png) [@nico](https://forum.kirupa.com/u/nico)
#### Post date: [February 15, 2009, 11:29am UTC](https://forum.kirupa.com/t/help-textfield-resizing/281923/1 "2009-02-15T11:29:56Z")

</div>

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 🙂

Thanks Guys!
