A Flash Developer Resource Site

Results 1 to 20 of 214

Thread: The elusive hitTest explained

Threaded View

  1. #1
    Gross Pecululatarian Ed Mack's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    2,954

    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 )
    Last edited by Ed Mack; 11-02-2002 at 09:27 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center