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<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<4) {
destThumbX = s*thumb_space;
destThumbY = 0*thumb_rowspace;
} else if (3<s and s<8) {
destThumbX = (s*thumb_space)-(4*thumb_space);
destThumbY = 1*thumb_rowspace;
} else if (7<s and s<12) {
destThumbX = (s*thumb_space)-(8*thumb_space);
destThumbY = 2*thumb_rowspace;
} else if (11<s and s<16) {
destThumbX = (s*thumb_space)-(12*thumb_space);
destThumbY = 3*thumb_rowspace;
} else if (15<s and s<20) {
destThumbX = (s*thumb_space)-(16*thumb_space);
destThumbY = 4*thumb_rowspace;
}
easeName(destThumbX,destThumbY,currentSubThumb);