Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I have a hittest that isn't a square boundry? 1

Status
Not open for further replies.

WhiteTiger

Programmer
Jun 26, 2001
605
US
I've been using Flashes hittest to test if 'paintballs' or their splat hit an object after flight animation...but I'd like it to detect if the object itself hit it, not just a square area. because in the corners I dont have pieces of the object...looks kinda funny when I didn't hit a button and it goes anyhow. Regards,
Anth:cool:ny
 
There are two formats for hitTest

1. clip.hitTest(target);//tests for collision of two clips by their rectangular bounding boxes

2. clip.hitTest(x,y,shapeflag);//set shapeflag to "TRUE" and it tests if the clip hit an actual pixel on the screen, ignoring the bounding box.

Use 2

Eg if your paintball clip is duplicated at the mouse position you can test if there's a hit by doing something like this...

clip.hitTest(_root._xmouse,_root._ymouse,true);

Slainte

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top