Problem repositioning MC’s along _y

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:

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.