# Evenly Spacing TextFields

**URL:** <https://forum.kirupa.com/t/evenly-spacing-textfields/274878>\
**Category:** flash\
**Created:** [November 6, 2008, 5:04am UTC](https://forum.kirupa.com/t/evenly-spacing-textfields/274878 "2008-11-06T05:04:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [November 6, 2008, 5:04am UTC](https://forum.kirupa.com/t/evenly-spacing-textfields/274878/1 "2008-11-06T05:04:25Z")

</div>

I’m creating rows of Sprites (containing textfields) and right now they are placed 50px apart:

```auto

for (var i:int=0; i < answers.length; i++) {
    var answer:String = answers*;
    var answerSprite:Sprite = new Sprite;
    answerSprite.y = i * 50;
}

```

But what I would like to do is create 30px of space in between each textfield regardless of the height of each textfield. so I created a var to find out the height of each textfield as it is created:

```auto

var answerHeight:Number = Math.ceil(answerSprite.height); // single lines are 20px and double lines are 36px

```

My tired brain is having trouble with the equation though and I could use some help:

```auto

answerSprite.y = (i * answerHeight) + 30; // CREATES STRANGE GAPS

```
