var i:Number = 0;
function goMe(){
if (i >= myArray.length){
clearInterval(myInterval);
i="0";
}
eval(myArray*.instance).slideTo(0,i*myArray*.instance._height,1,"easeOutBounce");
i++;
}
i’m using this code to cycle through an array and move the movie clips to x:0, and y:height of clip, times whatever number it is… if there are 4 objects in the array, object 1 would be 1 times it’s own height… etc… so they’re spaced out.
however, when i resize my stage, i’d like to have them arrange differently… into columns… but i’m not sure how to specify breaking them off into columns. i tried something like this:
var cCount:Number = 2;
var rCount:Number = 1;
function goMe2(){
//number of columns to make
//number of rows in each column
//height of each item in row
var itemHeight:Number = myArray[1].instance._height;
//width of each column
var colWidth:Number = myArray[1].instance._width;
if (i >= myArray.length){
clearInterval(myInterval);
i="0";
rCount=0;
}
if(rCount<="2"){
eval(myArray*.instance).slideTo(0,rCount*itemHeight,1,"easeOutBounce");
rCount++;
i++;
}else{
eval(myArray*.instance).slideTo(cCount*colWidth,cCount*rCount,"easeOutBounce");
rCount++;
i++;
}
}
… but it didn’t sort correctly
you can see what i mean here: http://www.ericgibb.com/sd.html