Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我花了很长时间让一个 MovieClip 来检测在 ActionScript 3.0 中是否有另一个 MovieClip 被拖到它上面?有谁知道一个好的实现。
谢谢
你也可以使用DisplayObject.hitTestObject()
DisplayObject.hitTestObject()
movieClipOnStage.hitTestObject(movieClipYouAreDragging)
如果您在拖动时(使用或事件)在循环上执行此操作Event.ENTER_FRAME,您应该能够获得您想要的结果。Event.MOUSE_MOVETimer
Event.ENTER_FRAME
Event.MOUSE_MOVE
Timer
DisplayObjectContainer.getObjectsUnderPoint()可以为您执行此操作。