Hiya folks.
I have encountered an interesting problem regarding nested DisplayObjectContainers and their ability to use hitTestObject. Wondered if someone with more familiarity with this particular function might offer a work-around (aside from the quite heavy-handed solution I am using now).
Assume following:
[LIST]
[]SpriteA contains SpriteA’ and SpriteB contains SpriteB’
[]SpriteA & SpriteB are sibling containers (meaning they have the same parent)
[]SpriteA’ & SpriteB’ are displayed using the drawing API
[]SpriteA & SpriteB “appear” to overlap
[/LIST]
Now given those criteria SpriteA.hitTest(SpriteB) return false. I am assuming this is because the bounding does not include visual elements constructed with the drawing API in nested child objects? What’s the deal? :trout:
Currently my only solution is to take data that helps in drawing the child nodes, manually create a Rectangle for each, and do an intersection of those two Rectangles. This involves a few intermediary steps that are include converting from isometric to actual screen coordinates and then a localToGlobal conversion.
Thanks for any clues.