# Problem repositioning MC’s along \_y

**URL:** <https://forum.kirupa.com/t/problem-repositioning-mc-s-along--y/149034>\
**Category:** flash\
**Created:** [May 25, 2005, 1:56pm UTC](https://forum.kirupa.com/t/problem-repositioning-mc-s-along--y/149034 "2005-05-25T13:56:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobijas20](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@tobijas20](https://forum.kirupa.com/u/tobijas20)\
**Post date:** [May 25, 2005, 1:56pm UTC](https://forum.kirupa.com/t/problem-repositioning-mc-s-along--y/149034/1 "2005-05-25T13:56:31Z")

</div>

I have 2 MC’s named “box1” and “box2”. Each one has dynamic text field named content\_txt (content\_txt.autoSize = true) and loads some text data from XML file.  
Box2 is on the top and box1 on the bottom. I need function that checks the height of box2, or of it’s content\_txt and puts box1 on exact distance along \_y axis.  
I have tried with this code:

```auto
onEnterFrame = function () {
b1y = box2._y;
b1v = box2.content_txt.height; //or just box2.height
spacer = 20;
total = b1y + b1v + spacer;
box1._y += 5;
if(box1._y>total){
box1._y=total;
}
}

```

but it slides box1 without exact calculating of box2 height.
