About measuring dimensions

Let’s say I have an MC called “mainmc” with a 50x50 box inside of it. Also 50x200 textbox with a 50x50 mask over it, it scrolls etc. I’m trying to center the mainmc on the stage, but when I calculate the _height it takes into account the invisible masked text. Is there a way to only measure what is visible in an MC? Or is there another way around this?