views:

74

answers:

2

Hi,

I am having a hell of a time getting a MovieClip to detect whether another MovieClip is being dragged over it in ActionScript 3.0? Does anyone know of a good implementation.

Thanks

A: 

DisplayObjectContainer.getObjectsUnderPoint() can do this for you.

Joa Ebert
+1  A: 

You can also use DisplayObject.hitTestObject()

movieClipOnStage.hitTestObject(movieClipYouAreDragging)

If you do this on a loop while you are dragging (using an Event.ENTER_FRAME, Event.MOUSE_MOVE or a Timer event) you should be able to get the result you are after.

Reuben
I am actually using the on MOUSE_UP event for my implementation, but this is the right strategy.
Adrian Adkison