I’m trying to use a drag and drop activity in Adobe Presenter and discovered that _dropTarget doesn’t seem to be supported. The post said to use hitTest instead. The problem is that I can’t figure out a way to easily tweak my code. Anyone see a way to quickly change to hitTest? (Thanks for your help!)
Here’s the code:
stop();
finisher._visible = false;
var counter:Number = 0;
onEnterFrame = function():Void{
if(counter == 4){
finisher._visible = true;
finisher.nextFrame();
}
};
function dragSetup(clip, targ) {
clip.onPress = function() {
startDrag(this);
this.beingDragged=true;
this.gotoAndStop(“over”);
this.swapDepths(this.getNextHighestDepth());
};
clip.onRelease = clip.onReleaseOutside=function () {
stopDrag();
this.beingDragged=false;
if (eval(this._droptarget) == targ) {
this.onTarget = true;
feedback.gotoAndPlay("correct");
this.enabled = false;
counter++;
} else {
this.onTarget = false;
feedback.gotoAndPlay("incorrect");
this.gotoAndStop("hold");
}
};
//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(item1,dropzone1);
dragSetup(item2,dropzone2);
dragSetup(item3,dropzone3);
dragSetup(item4,dropzone4);