I am playing around with an iPad app and I am having a problem with the mouse “stopDrag”.
What I have are some movieclips that are on the stage. These objects are duplicated upon being clicked on and then the duplicated item can be dragged to a target and snaps into place. Or, if you miss the target or drop the item on the wrong target then the item is deleted.
This all works great if enough pressure is placed on the duplicated/dragged item. But, if you remove your finger softly while dragging, the item remains left the screen and doesn’t delete itself unless you go back and click and move it.
Does anyone have any ideas on how to remove this duplicated item for sure?
function stopDragObject(e:MouseEvent):void {
e.currentTarget.removeEventListener(Event.ENTER_FRAME, enterHandler);
e.currentTarget.stopDrag();
var index:int = lettersArray.indexOf(Class(getDefinitionByName(getQualifiedClassName(e.currentTarget))));
if (e.currentTarget.hitTestObject(targetArray[index])) {
e.currentTarget.x = targetArray[index].x;
e.currentTarget.y = targetArray[index].y;
reply_txt.text = "Yes, that is correct.";
}else {
removeChild(MovieClip(e.currentTarget));
reply_txt.text = "No, that's not right.";
}