hitTest for the lazy and dull-witted...
hitTest for the lazy and dull-witted (such as myself)...
I know this thread was a hot topic a whole year ago, but i'm sure finding it interesting today. after having many of the problems expressed since Ed Mack's (Mack Daddy of HitTest) initial post, I used the simple shapFlag argument presented by "The_Xell" in Groovy.fla :
onClipEvent (mouseMove) {
if (_root.dumBell.hitTest(_root.circ._x,_root.circ._y , true)) {//checks if the circle is on the black area, not bounding box
_root.hit = true;
} else {
_root.hit = false;
}
}
I used a "dumbell" shaped object as the area to be hit and "circ" instead of the mouse position. I then CHEATED by duplicating the dumbell and putting the code on the duplicate a layer beneath, enlarging it so that the center of "circ" would hitTest before reaching the dumbell proper. works great if the dumbell doesn't have to move. Maybe I'm a dumbell for taking the less exciting route, but it was quick and simple. maybe novice actionscripters will dig it.