# \[as2\] Collision Detection

**URL:** https://forum.kirupa.com/t/as2-collision-detection/312028
**Category:** Uncategorized
**Created:** [July 22, 2010, 8:36pm UTC](https://forum.kirupa.com/t/as2-collision-detection/312028 "2010-07-22T20:36:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![marcelozep](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@marcelozep](https://forum.kirupa.com/u/marcelozep)
#### Post date: [July 22, 2010, 8:36pm UTC](https://forum.kirupa.com/t/as2-collision-detection/312028/1 "2010-07-22T20:36:04Z")

</div>

Hi.  
I´d like to know how can I make a collision detection between two objects with complex shapes.  
Each object has a parent movieclip.  
Example:

\_root.obj1.child  
\_root.obj2.child

I need to make a collision detection test between each child of those two objects.

As far as I know. I can use the hitTest for bitmap. But isn´t working.  
I´m not finding the right way to do it.  
I think it needs localToGlobal for x and y for each child clip coordinates and matrix, because obj1.child and obj2 rotates on \_root.onEnterFrame.

The function itself would be something like this:

function checkCollision(a:MovieClip, b:MovieClip):Boolean{  
var boolean:Boolean = a.hitTest(b)  
return boolean  
}

And the function call would be something like this:

checkCollision(obj1.child, obj2.child)

Anybody know how?

Please, I can´t use GSkinner´s class.

Thanks
