OK here's an interesting one, reposted in here because you guys seem smarter and more helpful than the people in the general MMF2 area...

I am detecting the distance between two points - think of it as the distance of multiple objects from the central point/player. Now, I can store the distance between the 'player' and each object in one of that object's alterable values, which is great. However, I'd like to 'sort' them by which one is the closest, to which is the furthest away. Say, the closest one should be assigned a value of 1, the second closest a value of 2, etc. etc. so that I can sort them accordingly. This is for iOS, Android and other formats, so I can't really be using extensions which aren't compatible.

All I can think is to keep repeating a loop, then when the object's 'distance' value is equal to the loop index, to set its 'order' value to that of another counter, and add 1 to that counter, repeatedly until all of the objects have been given an 'order' value. Problem with this method is I don't know where to make the loop stop (unless there's away to find the highest alterable value), and a large fastloop like this could cause serious problems on the mobile platforms.

Any suggestions?