Don't write you own sorting algorithm unless you have a smarter one. What data do you have and how would you order the players rank manually? I assume that there is a "score" data in the json. Something like player1: score 3456, player 2: score 4456 and so on. Higher score, higher rank. I never worked with json data driven animation, but you already managed to get those data into AE. The next step is to grab all those scores into an array. Just saw a tutorial and in this it was only a matter of putting a line of code (the exact data address) into a text layer. In the example, he wrote "footage("players.json").dataValue([0,0,0])". To get this and all the others into an array, it should work like this (following the sample from the tutorial) - assuming that your score is always the 2nd data entry (If you show me your code, I can give you better help!): myarr = [footage("players.json").dataValue([0,0,0]), footage("players.json").dataValue([0,1,0]), footage("players.json").dataValue([0,1,0]), ...]; This should evaluate into something like myarr = [1542,4595,9784, ...] Now you can SORT those numbers, highest to lowest. myarr.sort(function(a, b) { return b - a; }); Result is now myarr = [9784, 4595, 1542, ...] For performance reasons and "the fine order" I would outsource the sorting to a textlayer. Otherwise, you'll have to repeat the same and same calculation over and over again for all pre-comps, which is unnecessary. I assume that this is now onto a text layer called "Rank-Text-Layer". For each pre-comps position property, we will now grab your individual score, look it up in the sorted array and use the index of your score-in-array entry to determine, which null position we should take. Easy! //grab the array and write it's content to "ranks" - don't nail me on this line - did it before, but am not in front of AE right now ranks = eval(thisComp.layer("Rank-Text-Layer").text.sourceText.value); // get the score of this specific player / pre-comp like you did before myscore = ... // look up your score in the sorted score array and return the index of it - aka the rank. // we need to add 1 because arrays start at 0, but ranks at 1 myrank = ranks.indexOf(myscore) + 1; // grab the positions of the nulls, because we are lazy - make sure that the seven nulls are the first 7 layers in your comp and // also that they lined up correctly! 1st null in layers stack = 1st rank. nulls = []; for (i = 1; i <= 7; i++){ null = thisComp.layer.transform.position; nulls.push(null); }; // do the magic: we know the rank of this specific pre-comp. We grabbed the nulls from 1st rank to last, // so we can use myrank as index of nulls to get the position of the corresponding null // if the pre-comp is rank 3, it will take the position of 3rd null, which represent 3rd place. If it's rank 5, it is the 5th place and so on nulls[myrank]; Let me know, if this helps in any way! *Martin
... View more