Need help with calculating order of boxes as per there position

I am working on sequence quiz engine. I have a function to sort boxes (dynamically generated Movieclips) which calls on every release of boxes.

function sortboxes ():void
{
 _boxes.sortOn ( 'y', Array.NUMERIC );
 for (var i:int = 0; i < _boxes.length; i++)
 {
  TweenLite.to ( _boxes*, 0.5, { x:50, y:(_boxes*.height+10) * i+100, ease:Expo.easeInOut } );
 }
 
}

also I have a initial position of boxes:

function switchPlaces ()
{
 box1.x = 50;
 box2.x = 50;
 box3.x = 50;
 box4.x = 50;
 box1.y = 100; // for now initial position is in sequence
 box2.y = 140;
 box3.y = 180;
 box4.y = 220;
}

Whenever I swap the positions as per correct sequence and click Submit I am gettin a new y positions.

function shoResult (e:MouseEvent):void
{
 //trace (box1.y,box2.y,box3.y,box4.y);
}

but I need to have a order which i can send to PHP database.
for Eg. my current order is 1,2,3,4 but i need to send an order after arranging boxes depending on final state of boxes. say 3,4,2,1. but how to catch the positions and how to link order to those positions?

somebody suggest me to make 3 arrays: initialState, finalState and order
and I tried that way but I didnt gat what I want. any idea?