Copy link to clipboard
Copied
hitTestObject only detects hits on one of the objects in a container, and how do I go about removing the objects from the stage?
Copy link to clipboard
Copied
If you check each object in the sprite for a hitTest using a loop then you should get what you want. If the only child objects in the sprite are the ones you bump into then you could just loop thru them using the numChildren property of the sprite and getChildAt() method. Otherwise, if there are other objects ion the sprite that you do not want to include then you might either need to use an array to identify the hittable objects or have some way of differentiating them for the looped hitTests.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now