# Having trouble placing a textfield based on # of characters

**URL:** <https://forum.kirupa.com/t/having-trouble-placing-a-textfield-based-on-of-characters/328883>\
**Category:** flash\
**Created:** [June 27, 2012, 7:11pm UTC](https://forum.kirupa.com/t/having-trouble-placing-a-textfield-based-on-of-characters/328883 "2012-06-27T19:11:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m2244](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@m2244](https://forum.kirupa.com/u/m2244)\
**Post date:** [June 27, 2012, 7:11pm UTC](https://forum.kirupa.com/t/having-trouble-placing-a-textfield-based-on-of-characters/328883/1 "2012-06-27T19:11:43Z")

</div>

Hello,

I have code that creates dynamic textfields and places them onto buttons. The amount of text varies since it is pulled from XML files and these files are always changing. I would like to center the TF both vertically and horizontally. This seems to be difficult with dynamic textfields. Is there a way to do this based on the width and height of the textfield. Or do I need to read the number of characters and place the TF based on that?

Thanks for the help.
