Array with mc's x position

Hi,

This might sound odd, but i have a bunch of mc’s on stage and i need to get an array of all mc’s sorted by their x or y position. That way i can animate them in different ways by rearranging the array. (IE top down etc.)

So, a bunch of movieclips at random depths, get array with all mc’s, arrange by x or y.

Any ideas?

I was thinking numChildren and a loop to get all the mc’s. But im lost when it comes to the filtering/arrangeing