# Need to set variable x-position on textfields

**URL:** <https://forum.kirupa.com/t/need-to-set-variable-x-position-on-textfields/289341>\
**Category:** Uncategorized\
**Created:** [May 29, 2009, 4:58am UTC](https://forum.kirupa.com/t/need-to-set-variable-x-position-on-textfields/289341 "2009-05-29T04:58:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icebot07](https://avatars.discourse-cdn.com/v4/letter/i/e99b99/32.png) [@icebot07](https://forum.kirupa.com/u/icebot07)\
**Post date:** [May 29, 2009, 4:58am UTC](https://forum.kirupa.com/t/need-to-set-variable-x-position-on-textfields/289341/1 "2009-05-29T04:58:27Z")

</div>

so, i have these 3 things on the stage:

a date\_txt (textfield)  
a pipe\_mc (movieclip)  
and titlefield (textfield).

here’s my code, i can’t get them display properly. i think only date\_txt should have autosize set to left, but it doesn’t have any effect one way or the other as far as i can see.

```auto
 var titleFormat:TextFormat = new TextFormat();
            titleFormat.color=0x000000;
            titleFormat.size=20;
            titleFormat.bold=true;

            title_txt.antiAliasType = AntiAliasType.ADVANCED;    
            title_txt.thickness = -200;
            //title_txt.autoSize=TextFieldAutoSize.LEFT;
            title_txt.selectable=false;
            title_txt.width = 300;
            title_txt.y = -51
            title_txt.defaultTextFormat=titleFormat;

            var dateFormat:TextFormat = new TextFormat();
            dateFormat.color=0x999999;
            dateFormat.size=20;    

            date_txt.y = -51;
            date_txt.autoSize=TextFieldAutoSize.LEFT;
            date_txt.antiAliasType = AntiAliasType.ADVANCED;    
            date_txt.defaultTextFormat=dateFormat;    
            
            var pipe_mc = new PipeMC();
            pipe_mc.y = -51;
            
            date_txt.x = 3;
            pipe_mc.x = date_txt.x = date_txt.width;
            title_txt.x = date_txt.x + date_txt.width + pipe_mc.x + pipe_mc.width;
            
            addChild(date_txt);
            addChild(pipe_mc)
            addChild(title_txt);

```

so, the order is date + pipe + title. i’m plum out of idears. and tired. any help appreciated.
