# BitmapData hitTest Problem on Rotation

**URL:** <https://forum.kirupa.com/t/bitmapdata-hittest-problem-on-rotation/230033>\
**Category:** flash\
**Created:** [June 22, 2007, 4:10am UTC](https://forum.kirupa.com/t/bitmapdata-hittest-problem-on-rotation/230033 "2007-06-22T04:10:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadal](https://avatars.discourse-cdn.com/v4/letter/k/ea5d25/32.png) [@kadal](https://forum.kirupa.com/u/kadal)\
**Post date:** [June 22, 2007, 4:10am UTC](https://forum.kirupa.com/t/bitmapdata-hittest-problem-on-rotation/230033/1 "2007-06-22T04:10:16Z")

</div>

Guys need help on BitmapData HitTest

I know there’s a lot of code about hitTest ,and it works  
but he problem is I have a rotation image that have unwanted behavior  
if I rotate the image.

it works great if its a circle but not with other shape like box

seems like the boundary box problem

here’s the code

var pt:Point= new Point(ld2.x2,ld2.y2);  
var pt2:Point= new Point(elementTarget.x2,elementTarget.y2);  
var bmapDataS:BitmapData = new BitmapData(ld2.width, ld2.height, true, 0x00000000);  
var bmapDataT:BitmapData = new BitmapData(elementTarget.width, elementTarget.height, true, 0x00000000);  
bmapDataS.draw(ld2, new Matrix());  
bmapDataT.draw(elementTarget, new Matrix());

```
    if (bmapDataS.hitTest(pt,0x80,bmapDataT,pt2,0x80)) {    
            ld2.removeEventListener(Event.ENTER_FRAME,enterFrameHandler3);
            loop=0;
        }

```

where ld2 and elementTarget is Loader and I load the Image using URLRequest

Thanks for the help
