"snapping" draggable attached clips to each others' edges?

Sorry for the confused subject line, I’ve managed to confuse myself now regarding this…

I’m attaching MC’s from the library when a button is clicked and changing the name and depth of each newly attached clip each time the button is clicked. Additionally I’m swapping depths of the clicked MC with the most recent (most current) MC when they are clicked and dragged around the stage. Now it works reasonably well so far. What I want to do now is have a clip snap to the edge of a previously spawned MC. All the clips being attached are just rectangles so their bounding box will do fine. But how do use the getBounds(); function when I don’t know the name of the drop target?

All this is supposed to do is allow the user to select the shape they want from a “catalogue” and drag them around on screen to arrange them. While being arranged, the MCs should snap to the left or right edge of the MC it was released over.

How I’m attaching MCs…

on (press){
// increment name and depth level of attached MCs…
nameCount = nameCount+1;
depthCount = depthCount+1;
//
//name the child object…
doorName = “doorpanel” + nameCount.toString();
//
// add a movieclip from the library
_level0._itemLib.empty_mc.attachMovie(“mc_view_doorpanels1”, doorName, depthCount);
//
// store the path to the new object to make referencing shorter…
_level0.pathToObject = _level0._itemLib.empty_mc.doorName.toString();
//
// Tell the attached MC what frame it should be in.
_level0.pathToObject.gotoAndStop(“flat”);
//
// Start the property assignments…
_level0.pathToObject.setProperty (_level0.pathToObject, _x, 376);
_level0.pathToObject.setProperty (_level0.pathToObject, _y, 279);
//
// Add item to purchase array for the purchase order…
_level0.purchaseArray[nameCount] = new unitItem(doorName.toString(), “Display Frame”, “80 x 96 Display Frame”, “80 x 96”, “100.00”);
//
//
if (_level0.stylesLoaded == “”) {
_level0.mc_styleselection.loadMovie(“libs/lib_doorstyles.swf”);
} else {
_level0.mc_styleselection.loadMovie(“libs/lib_doorstyles.swf”);
}
}

And what’s attached to the button of the soon-to-be-draggable MC in the library…

on (press) {
_level0.currentSelected = this;
this._alpha = 50;
this.swapDepths(_level0.mc_doorpanels.depthCount);
// After much trouble with global and local coordinates, a shot in the dark…
point = new object();
point.x = this._x;
point.y = this._y;
globalToLocal(point);
// Don’t know if above made a difference but below worked out…
x_pos = _level0.currentSelected._x;
y_pos = _level0.currentSelected._y;
// add the offset to position the MC centered with the panel MC…
y_pos = y_pos + 95;
x_pos = x_pos - 32;
startDrag(this, false, -190, -90, 175, 77);
setProperty(_level0._itemLib.mc_isSelected, _visible, 1);
setProperty(_level0._itemLib.mc_isSelected, _x, x_pos);
setProperty(_level0._itemLib.mc_isSelected, _y, y_pos);
}
on (release) {
this._alpha = 100;
x_pos = _level0.currentSelected._x;
y_pos = _level0.currentSelected._y;
y_pos = y_pos + 95;
x_pos = x_pos - 32;
setProperty(_level0._itemLib.mc_isSelected, _x, x_pos);
setProperty(_level0._itemLib.mc_isSelected, _y, y_pos);
_level0.thisStyle = this.mc_style_insert;
this.stopDrag();

}

So I need to get the bounds of whatever underneath _level0.currentSelected. I don’t know what that name is but I should be able to get with hittest or droptarget, no?

I also haven’t figured out how I’m going to determine whether the user released the MC closer to the right or left edge of another MC to snap to the appropriate side.

Any insight offered is greatly appreciated.