Help with my forloop

What I have is the initial forloop that gets the fabric sections. Then a forloop within this loop to get the subsections.

the locations of where the thumbs in the subsection should go are stored in the destThumb variables and then fed through to an easing function.

however, each subsection group is also aligned depending on the previous subsection._height. So the thumbs are going to their right relative positions, but the subsections are not.
I’m assuming this is because the ._heights are being calculated instantly as the thumbs are beginning to ease, therefore making subsection only the height of one row of thumbs.

now what are my solutions? canI use a setInterval somewhere to have the forloop pause before it loops again? Allowing time for the thumbs to ease in place creating the final height?

this is just the top snippet of code:

for (var i = 0; i<theFabrics.length; i++) {

var storeHeight = materialSection._height;
var storeYLoc = materialSection._y;
var matFabrics = theFabrics*.childNodes;
var matType = theFabrics*.attributes.type;
var materialSection = mainSubThumbs.createEmptyMovieClip("SubThumbsHolder"+i, i);
//thumbnail holder


for (var s = 0; s&lt;matFabrics.length; s++) {
	var currentSubPicture = matFabrics[s];
	var currentSubThumb = materialSection.createEmptyMovieClip("subthumb_mc"+s, s);
	var containerSubThumb = currentSubThumb.createEmptyMovieClip("subcontainer"+s, s);
	currentSubThumb.attachMovie("subthumb_bg_mc","subthumb_bg_mc"+s,s-1);
	if (s&lt;4) {
		destThumbX = s*thumb_space;
		destThumbY = 0*thumb_rowspace;
	} else if (3&lt;s and s&lt;8) {
		destThumbX = (s*thumb_space)-(4*thumb_space);
		destThumbY = 1*thumb_rowspace;
	} else if (7&lt;s and s&lt;12) {
		destThumbX = (s*thumb_space)-(8*thumb_space);
		destThumbY = 2*thumb_rowspace;
	} else if (11&lt;s and s&lt;16) {
		destThumbX = (s*thumb_space)-(12*thumb_space);
		destThumbY = 3*thumb_rowspace;
	} else if (15&lt;s and s&lt;20) {
		destThumbX = (s*thumb_space)-(16*thumb_space);
		destThumbY = 4*thumb_rowspace;
	}

	easeName(destThumbX,destThumbY,currentSubThumb);

you would have to calculate the height before hand I guess

put it in the xml?

or i guess i could calculate the height earlier, somehow. Thanks

Another question. the thumbs do ease to their spots. but all at the same time. How can I have them ease one after another?

if you use loadClip/ / onIntialise() or something checks size once loaded

you increment the tween in terms of the time it takes so the first is 11, the next is 12

im using a loadClip.
do i need to use some sort of setInterval function?

tweens have their own setinterval() as it were

you have to remember I doing this in my spare time don’t expect me to remember the specifics