I am trying to create a menu using a for loop. I got the loop working at the data to display, but after the 3rd button I want to put the other 3 buttons to the right of the first three, if that makes sense.
Right now the first 3 displays, and the last 3 are moved over where they need to be, but it’s still below the 3rd one, how do I get the 4th item to line up with the 1st time on the x axis?
Here is that code I am using.
var mc:MovieClip;
var yCount:Number = 0;
for (var i:int=0; i<navigation.length; i++)
{
mc = new menuButton ;
var yCord:Number = 0;
mc.labelText.text = navigation*.name;
//mc.y = i * 20;
mc.buttonMode = true;
yCount++;
if (yCount < 4)
{
mc.y = i * 20;
trace("y count");
}
else
{
mc.y = 0 + i * 20;
mc.x = mc.width + 1;
}
menu.menuHolder.addChild(mc);
navigation* = mc;
}
Thanks for all the help!