I have an array of movie clips (representing band members) which have various properties, among them them a property which tells where the band member went to after they left their current band. For those who formed a new group, I want to create an array. Within that array, I want to group all the ones that left for the same group into secondary arrays. So, if you had five band members and 2 of them left for group X and 3 left for group Y. What's the best way to do this? This is, roughly, my code:
var newGroupArr:Array = new Array() //this will hold all members leaving for a new group
for (k=0;k<memberClips.length;k++){
if (memberClips[k].outcome == "new"){
//for all groups where memberClips[k].group is the same, create a new array within newGroupArr for those similar members.
}
}
Alternatively I suppose if I could do without a multidimensional array and just loop through all the members and say - for those members whose group is the same, perform this function, with the name of that same group passed as the parameter for the function. I guess the trouble I'm having is identifying who's the same.
