# Equal spacing for horizontal navigation

**URL:** <https://forum.kirupa.com/t/equal-spacing-for-horizontal-navigation/227393>\
**Category:** flash\
**Created:** [May 29, 2007, 9:41pm UTC](https://forum.kirupa.com/t/equal-spacing-for-horizontal-navigation/227393 "2007-05-29T21:41:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onecommoncode](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@onecommoncode](https://forum.kirupa.com/u/onecommoncode)\
**Post date:** [May 29, 2007, 9:41pm UTC](https://forum.kirupa.com/t/equal-spacing-for-horizontal-navigation/227393/1 "2007-05-29T21:41:49Z")

</div>

I am building a horizontal navigation and I am having trouble getting equal spacing between the mc’s. Inside the mc’s there is a text box that will contain different titles.

```auto

function buildNav():Void
{
    var navTitle:Array = new Array({title: "home", path: "index.html"}, 
                                   {title: "tools", path: "tools.html"}, 
                                   {title: "specs", path: "specs.html"}, 
                                   {title: "process", path: "process.html"}, 
                                   {title: "reference", path: "reference.html"}, 
                                   {title: "best practices", path: "practices.html"});
    
    var navHolder:MovieClip = r.createEmptyMovieClip("navHolder", 0);
    
    var tempX:Number;
    
    for(var i:Number = 0; i < navTitle.length; i++)
    {
        var mc:MovieClip = navHolder.attachMovie("nav_mc", "nav_mc" + i, i, {_x: tempX});
        mc.id = i;
        
        tempX = ((mc._x + mc._width) + 60);
        
        var navFormat:TextFormat = new TextFormat();
        navFormat.leftMargin = 10;
        navFormat.rightMargin = 10;
        
        mc.nav_content.nav_content_txt.autoSize = true;
        mc.nav_content.nav_content_txt.text = navTitle*.title.toUpperCase();
        
        mc.nav_content.nav_content_txt.setTextFormat(navFormat);
        
        mc.nav_hit._width = mc.nav_content._width;
        
        mc._y = 6;
}
}

```
