# Need to set up dynamic spacing to close width between a few textfields

**URL:** <https://forum.kirupa.com/t/need-to-set-up-dynamic-spacing-to-close-width-between-a-few-textfields/289297>\
**Category:** Uncategorized\
**Created:** [May 28, 2009, 5:14pm UTC](https://forum.kirupa.com/t/need-to-set-up-dynamic-spacing-to-close-width-between-a-few-textfields/289297 "2009-05-28T17:14:36Z")\
**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 28, 2009, 5:14pm UTC](https://forum.kirupa.com/t/need-to-set-up-dynamic-spacing-to-close-width-between-a-few-textfields/289297/1 "2009-05-28T17:14:36Z")

</div>

i’ve been hacking away at this and can’t seem to get it…i need to close the space between the date,pipe\_mc and title fields and can’t seem to figure out how to do it right…

```auto
 var pipe_mc:MovieClip = new PipeMC();
            pipe_mc.y = 1;
       
            var dateline:Sprite = new Sprite();
            dateline.x = 0;
            dateline.y = -51;

            addChild(dateline);
            dateline.addChild(date_txt);
            dateline.addChild(title_txt);
            dateline.addChild(pipe_mc);
            date_txt.x = 3;
            
            var spacer:Number = 10;

            if (date_txt.textWidth >= 90) {
                
            var pipeX = pipe_mc.x;
            
            pipeX = 90;
            pipeX = date_txt.x + date_txt.width + 18;
            title_txt.x = pipeX + pipe_mc.width + spacer;
                    
            }  
            
            else if (date_txt.textWidth <= 90) {
                
            var pipeX = 80;
            pipeX = date_txt.x + date_txt.width - 18;        
            title_txt.x = pipeX + pipe_mc.width + spacer;    

            }

```
