The reason it's not working is because the top DisplayObject (the one being dragged, is stealing the events for itself).
You have a few options, 1st is adding the MOUSE_MOVE event to the dragged object instead of the particular spot, and you could do a hitTestObject() to verify if they overlap, or a hitTestPoint() if the mouse is inside the particular spot.
So basically do this:
draggedObject.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
function onMouseMove(evt : MouseEvent) : void {
var particularSpot : MovieClip = MovieClip(evt.currentTarget.parent).getChildByName("particular spot object name");
if(particularSpot.hitTestPoint(evt.mouseX, evt.mouseY)) // or use hitTestObject
{
// The mouse is on top of particular object
}
else
{
// The mouse is not on top of particular object
}
}
Second one is to disable mouse events for the dragged object with mouseChildren
and mouseEnabled
properties, but that would break your current dragging, you would have to rearrange your events to the dragged object parent or the stage.
mouseChildren
property (try setting it to false), or setting up a temporary listener for mouse move events on the stage in conjunction withgetObjectsUnderPoint()
– Discommend