# hitTestPoint Help

**URL:** <https://forum.kirupa.com/t/hittestpoint-help/318779>\
**Category:** flash\
**Created:** [January 30, 2011, 8:07am UTC](https://forum.kirupa.com/t/hittestpoint-help/318779 "2011-01-30T08:07:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanDaMan](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@DanDaMan](https://forum.kirupa.com/u/DanDaMan)\
**Post date:** [January 30, 2011, 8:07am UTC](https://forum.kirupa.com/t/hittestpoint-help/318779/1 "2011-01-30T08:07:04Z")

</div>

I’m trying to set up a collision so that when a bullet hits a wall it is destroyed. Here is the snippet of code I am using:

```php

while (_root.newWall.hitTestPoint(x, y+radius, true)) {
y-=Math.sin(angle);
deleteMe=true;
}
while (_root.newWall.hitTestPoint(x, y-radius, true)) {
y+=Math.sin(angle);
deleteMe=true;
}
while (_root.newWall.hitTestPoint(x-radius, y, true)) {
x+=Math.cos(angle);
deleteMe=true;
}
while (_root.newWall.hitTestPoint(x+radius, y, true)) {
x-=Math.cos(angle);
deleteMe=true;
}
if (deleteMe) {
deleteMe=false;
removeEventListener(Event.ENTER_FRAME, eFrame);
_root.removeChild(this);
}

```

This method works great for when detecting a collision between other moving instances and the walls, but for some reason with the bullets I get this error message when they almost touch the wall and Flash freezes and I usually have to restart it:

```php

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
at Bullet/eFrame()

```

I attempted to debug it and it said that the problems were at the four lines beginning the while loop. Can someone help me please? Thanks 😃
