Need help with drag and drop interface

I need assistance from the good folks here.

============
Scenario
Flash has a classroom scene - three slides (or draggable objects), a slide projector (droptarget) and a screen on the wall. All three objects share the same droptarget.

A movieclip (info_mc) with four labels (each containing different information for the corresponding slide dragged onto droptarget) - ‘reset’, ‘slide1info’, ‘slide2info’ and ‘slide3info’ is positioned at the screen area. Default to ‘reset’ (empty frame) since nothing has been dragged to the droptarget when the swf loads.

If the user drags an slide1 onto the droptarget, the movieclip at the screen area will jump to the corresponding frame label

info_mc.gotoAndStop(“slide1info”);

But the droptarget can only accomodate one object at a time. When the user drags slide2 over the droptarget where slide1 already resides, slide1 will move back to its original position.

And if the user drags a slide out of the droptarget (i.e. nothing at the droptarget), info_mc will gotoAndStop (“reset”).

I managed to make some headway. See the attached .zip for FLA and SWF.

With reference to the FLA attached in the zip file, where do I tweak the actionscript such that if slide1 already resides at the droptarget and I want it to return to its original position when I drag slide2 to the droptarget.

Right now, the script doesn’t allow me to drag another clip to the droptarget when it’s already occupied (i.e. by virtue slide2.onTarget = false; as long as slide1 is at the droptarget). I have to drag out slide1, leave the droptarget empty before I can drag slide2 or slide3 in.

Current actionscript in FLA


function dragSetup(clip, targ) {
    clip.onPress = function() {
        startDrag(this);
        this.beingDragged=true; 
    };
    clip.onRelease = clip.onReleaseOutside=function () {
        stopDrag();
        this.beingDragged=false; 
        if (eval(this._droptarget) == targ) {
            slide1.onTarget = false;
            slide2.onTarget = false;
            slide3.onTarget = false;
            //etc
            this.onTarget = true;
            info_mc.gotoAndStop(this._name+"info");

        } else {
            this.onTarget = false;
            //check all the clips
            //! MEANS FALSE
            if(!slide1.onTarget && !slide2.onTarget && !slide3.onTarget){
            info_mc.gotoAndStop("reset");
            }            
        }
    };
    //the variables below will store the clips starting position
    clip.myHomeX = clip._x;
    clip.myHomeY = clip._y;
    //the variables below will store the clips end position
    clip.myFinalX = targ._x;
    clip.myFinalY = targ._y;
    clip.onEnterFrame = function() {
        //all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
        // then move the MC back to its original starting point (with a smooth motion)"
        if (!this.beingDragged && !this.onTarget) {
            this._x -= (this._x-this.myHomeX)/5;
            this._y -= (this._y-this.myHomeY)/5;
            //if the circle is dropped on any part of the target it slides to the center of the target
        } else if (!this.beingDragged && this.onTarget) {
            this._x -= (this._x-this.myFinalX)/5;
            this._y -= (this._y-this.myFinalY)/5;
        }
    };
}

dragSetup(slide1,dropzone);
dragSetup(slide2,dropzone);
dragSetup(slide3,dropzone);

Any assistance is greatly appreciated.

Rgds,
Dan