# Collision Detection with AS3

**URL:** <https://forum.kirupa.com/t/collision-detection-with-as3/256095>\
**Category:** flash\
**Created:** [March 30, 2008, 5:48pm UTC](https://forum.kirupa.com/t/collision-detection-with-as3/256095 "2008-03-30T17:48:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gregmax](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gregmax](https://forum.kirupa.com/u/gregmax)\
**Post date:** [March 30, 2008, 5:48pm UTC](https://forum.kirupa.com/t/collision-detection-with-as3/256095/1 "2008-03-30T17:48:27Z")

</div>

I have looked around, but can’t find any good examples on collision detection with AS3 :/. So that is why I am here with you smart people. I have a game that was built in AS2 that I now want to convert to AS3, but one major hurdle is the collision detection. This is what I had before:

[AS]  
var flag:Boolean = false;  
if(mc.hit.hitTest(rocket\_mc.getBounds(\_root).xMax, rocket\_mc.\_y, true)) { flag = true; }  
if(mc.hit.hitTest(rocket\_mc.getBounds(\_root).xMin, rocket\_mc.\_y, true)) { flag = true; }  
if(mc.hit.hitTest(rocket\_mc.\_x, rocket\_mc.getBounds(\_root).yMax, true)) { flag = true; }  
if(mc.hit.hitTest(rocket\_mc.\_x, rocket\_mc.getBounds(\_root).yMin, true)) { flag = true; }  
if(flag == true and rocket\_obj.live == true) {  
blowUp();  
} // end if  
[/AS]

is there any way to do this in AS3? It seems that they took out the hitTest funtion ☹
