# Vertically aligning different sized boxes

**URL:** <https://forum.kirupa.com/t/vertically-aligning-different-sized-boxes/242766>\
**Category:** flash\
**Created:** [October 30, 2007, 6:16am UTC](https://forum.kirupa.com/t/vertically-aligning-different-sized-boxes/242766 "2007-10-30T06:16:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsntos](https://avatars.discourse-cdn.com/v4/letter/d/67e7ee/32.png) [@dsntos](https://forum.kirupa.com/u/dsntos)\
**Post date:** [October 30, 2007, 6:16am UTC](https://forum.kirupa.com/t/vertically-aligning-different-sized-boxes/242766/1 "2007-10-30T06:16:18Z")

</div>

I have an attached movieclip that duplicates boxes vertically. All the boxes are different heights, because I’ve scripted it to adjust with the amount of xml text contained inside these boxes.

How do I get these boxes to line up right without overlapping eachother?

```auto

item = container.attachMovie("result_mc", "item" + i, i);

if (item.description._height >= item.resultBg._height) {
      item.resultBg._height = (20 + item.description._height + item.title._height);
            }

item._y = ((s) * (item.resultBg._height + spacing));
            s++;

```
