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.
我有两个 Sprite,它们有一个重叠区域。当鼠标滑过该区域时,我想让这两个 Sprite 都响应MOUSEEVENT.ROLL_OVER事件。但是,在我的情况下,只有上层 Sprite 会捕获该事件。我该如何解决这个问题?
MOUSEEVENT.ROLL_OVER
只需将这 2 个精灵放入另一个精灵中,然后像这样听新的精灵:
var sprite3:Sprite = new Sprite(); sprite3.addChild(sprite1); sprite3.addChild(sprite2); addChild(sprite3); sprite3.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);