Drag and Drop problem
I have several buttons within a container MC. What I want is to have it so that when a button is clicked on a particular MC is attached to the cursor (startDrag) and the container MC is moved to the side. The code below seems to work well for the attaching and moving part, but I can't figure out how to detach the MC from the cursor. I've tried numerous variations of stopDrag and removeMovieClip in a variety of areas (inside the container MC, inside the dragged MC, on the main timeline, etc), but nothing seems to work. Basically, what I want is that when the mouse is clicked again on a particular MC on a particular frame it checks to see if the two MCs overlap. If they do it advances the main timeline to the next frame. If they don't the dragged MC is simply removed and nothing else happens. So, any ideas for how to do this?
this.onRelease=function(){
attachMovie("keys", "keys", this.getNextHighestDepth())
startDrag(keys, true)
_root.inventory._x=780;
}