# Spacing two rows of MC's

**URL:** <https://forum.kirupa.com/t/spacing-two-rows-of-mcs/205966>\
**Category:** flash\
**Created:** [November 3, 2006, 5:06pm UTC](https://forum.kirupa.com/t/spacing-two-rows-of-mcs/205966 "2006-11-03T17:06:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coop](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@coop](https://forum.kirupa.com/u/coop)\
**Post date:** [November 3, 2006, 5:06pm UTC](https://forum.kirupa.com/t/spacing-two-rows-of-mcs/205966/1 "2006-11-03T17:06:21Z")

</div>

Hi all,

I knew how to do this, but I forgotten and it’s driving me mad.  
I am attaching movieClips in two rows four in each row, in a loop, but I carn’t work out how to get the second row and still space it on the \_x. There are 8 MC to be attached so I’ve determined the end of the first row when it’s half the length of the loop, and then set the \_x to 0 and the \_y so it will be below the first row, but then I carn’t continue the \_x on the second row.

I know this is easy

[AS]  
myXml = new XML();  
myXml.ignoreWhite = true;  
myXml.onLoad = function(success) {  
if (success) {  
loadBtn();  
} else {  
trace(“XML not loaded”);  
}  
};  
var btn\_spacing = 95;  
myXml.load(“alber.xml”);  
loadBtn = function () {  
start = myXml.firstChild.childNodes;  
for (var i = 0; i\<start.length; i++) {  
info = start\*;  
navBtn = nav\_mc.holder\_mc.attachMovie(“btn\_mc”, “btn\_mc”+i, i+1);  
navBtn.\_x = btn\_spacing\*i;  
if (i\>=start.length/2) {  
navBtn.\_x = 0;  
navBtn.\_y = 29;  
}  
navBtn.name\_txt.text = info.attributes.weight;  
}  
};  
[/AS]
