# Help with hitTestPoint

**URL:** https://forum.kirupa.com/t/help-with-hittestpoint/268582
**Category:** flash
**Created:** [August 15, 2008, 2:30pm UTC](https://forum.kirupa.com/t/help-with-hittestpoint/268582 "2008-08-15T14:30:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![G\_Nome](https://avatars.discourse-cdn.com/v4/letter/g/ecccb3/32.png) [@G\_Nome](https://forum.kirupa.com/u/G_Nome)
#### Post date: [August 15, 2008, 2:30pm UTC](https://forum.kirupa.com/t/help-with-hittestpoint/268582/1 "2008-08-15T14:30:15Z")

</div>

Hi,

hitTestPoint works fine in my application until the application is scaled. I’m hoping that someone can explain where I’ve gone wrong. In the following details the ‘source’ is a sprite being dragged over the ‘target’.

Display Hierarchy:  
stage  
frame [frame.swf]  
content [content.swf]  
source & target sprites

Hit Test Pseudo-code [content.swf]:  
var pt:Point = source.parent.localToGlobal( new Point( source.x, source.y ) );  
if( target.hitTestPoint( pt.x, pt.y, true ) )  
{ … }

Scaling Pseudo-code [frame.swf]:  
stage.scaleMode = StageScaleMode.NO\_SCALE;  
stage.align = StageAlign.TOP\_LEFT;  
…  
scaleX = \<computed scale\>;  
scaleY = \<computed scale\>;

Cheers!
