I have a submenu that is being populated from an XML file. The problem that I am having is that some of the text is shorter than the rest therefore the buttons are over lapping one another or being placed far away from the other. I am not sure what to do I have tried changing around the xml but that doesnt work well so here is my AS.
var curr_menu = this.createEmptyMovieClip("mcSubNav", 0);
curr_menu._y = SUBNAV_Y;
curr_menu._x = SUBNAV_X;
for (var i=0; i<totalNodes; i++) {
curr_item = curr_menu.attachMovie("mcSubNavButton","button", i);
curr_node= menu_xml.childNodes*;
curr_item.name = curr_node.attributes.name;
curr_item.link = curr_node.attributes.link;
curr_item.value = i;
curr_item.txtField.autoSize= "left";
var divider=(curr_item.value != 0)?"•":"";
curr_item.txtField.htmlText = divider+" <FONT><u>"+curr_item.name+"</u></FONT>";
var moveTo:Number= (eval(curr_item)._width+5)*i;
curr_item._x = moveTo;
As you can see the problem with the var moveTo.