Search code examples
actionscript-3collision-detection

AS3 find movieClip under movieClip being dragged


I have a function dragging movieClips on the stage which pass over other movieClips which I'd like to identify somehow.

Is there a "built-in" way to do this in AS3?

Thanks


Solution

  • Have a look at hitTestObject().

    Evaluates the bounding box of the display object to see if it overlaps or intersects with the bounding box of the obj display object.

    Parameters

    obj:DisplayObject — The display object to test against.

    Returns

    Booleantrue if the bounding boxes of the display objects intersect; false if not.