Can you change text alignment dynamically?

I have a dynamic text box on the stage with an instance name of caption. Is there are way to change the alignment dynamically? When the text is under 100 bytes, I want to center the text, if it is more than 100 bytes, I want to left align the text. Is there any way to do this?
Thanks… Bubba