We’ve been using Grant Skinners collision detection class for many of our projects.
It’s simple but genius :-).
Basically this is how it works:

1) finds the boundary intersection of both clips
2) creates a bitmap the same size as the intersection
3) draws the first clip into the bitmap in red
4) draws the second clip into the bitmap in white, using a difference blend
5) returns the boundaries of cyan in the bitmap (white difference blended on red makes cyan), or null if there is no cyan

We ported it to actionscript 3 for us and for you to enjoy!
But be aware, use at your own risk as it has not yet been tested to it’s limits.

If you have comments or improvements, let us know right here.

Download it here.

Thanks to Grant Skinner!


Technorati Tags: ,