Problem: attached MCs not aligning on release

I have draggable MCs that are attached to an empty MC on stage based upon button presses in another MC. The attached MCs are given incremented names and depths based upon the button presses when they are attached.

I need to have these resulting draggable MCs “snap” the edges to one another (right side and left side only) when dragged over each other rather than just overlapping. Since I don’t know ahead of time the names of these clips nor do I know how many there will be (since the user can select as many as they want and drag them out onto the stage), I can’t figure out how to keep track of them and how to get them to report back “who” they are. Hittest and _droptarget only seem to report back the empty MC that these draggable MCs are attached to. GetBounds() also seems to be presenting a problem in that the returned xMax, xMin, etc. are in the empty MC’s coordinate space. I’ve tried localToGlobal and GlobalToLocal to get the coordinates to work but haven’t had any success with it.

It was suggested to me to put them all in an array but the approach given assumed you know the names of all of the MCs on stage. I need to do this dynamically.

Any ideas on how to approach this with actionscript? I’ve seen this working elsewhere online at a far more elaborate level than what I need but I can’t get past this hurdle currently.

Any help is greatly appreciated, I’m at a stand still right now.