# Centering objects

**URL:** <https://forum.kirupa.com/t/centering-objects/218582>\
**Category:** Uncategorized\
**Created:** [March 9, 2007, 12:24am UTC](https://forum.kirupa.com/t/centering-objects/218582 "2007-03-09T00:24:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cryo\_burned](https://avatars.discourse-cdn.com/v4/letter/c/3be4f8/32.png) [@cryo\_burned](https://forum.kirupa.com/u/cryo_burned)\
**Post date:** [March 9, 2007, 12:24am UTC](https://forum.kirupa.com/t/centering-objects/218582/1 "2007-03-09T00:24:09Z")

</div>

i was trying to make something up:

```auto

_root.maintxt.x = (Stage.width / 2) + (_root.maintxt.width / 2);

```

where i have a text field named maintxt.

Where it should center the text field by as…

but it doesn’t… anyone got some ideas?
