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.
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;
}
}