The elusive hitTest explained
Back by popular demand!
HitTest is a very useful, and can be used for just about anything (like ductape really). There are two main forms that it takes:
Code:
if(this.hitTest(another_clip)){
// Something
}
This just tests the bounding boxes of this, and another_clip. If they hit, then the contents of the if will run.
Code:
if(this.hitTest(x, y, true)){
// Something
}
This tests the point x,y against the contents of this, the actual shape and not the bounding box. The true is what makes it test against the shape and not the bounding box.
Anyone else want to continue?
(if it's an irrelevant post, it'll be edited out as this is a guide sticky, not just a general bantering one ;))