# hitTestPoint doesn't work

**URL:** https://forum.kirupa.com/t/hittestpoint-doesnt-work/322967
**Category:** flash
**Created:** [June 10, 2011, 5:55pm UTC](https://forum.kirupa.com/t/hittestpoint-doesnt-work/322967 "2011-06-10T17:55:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SammyTheBear](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@SammyTheBear](https://forum.kirupa.com/u/SammyTheBear)
#### Post date: [June 10, 2011, 5:55pm UTC](https://forum.kirupa.com/t/hittestpoint-doesnt-work/322967/1 "2011-06-10T17:55:54Z")

</div>

Hi there!

I am trying to get hitTestPoint to work and can’t figure it out. I want the top left part of my chart (chartMC.ChartSection1) to change to blue when the red dot (hitDot) is on it. Attached you will find my file.

import flash.display.DisplayObjectContainer;  
import flash.display.DisplayObject;  
import flash.events.EventDispatcher;  
import flash.events.Event;  
import flash.display.MovieClip;  
import flash.geom.Point;

var chartHitOn:String = “0xb4c3e1”;  
var chartHitOff:String = “0xffffff”;  
var hitDot:MovieClip = new chartDot;  
var myColor1:ColorTransform = new ColorTransform;  
hitDot.x = 60;  
hitDot.y = -145;

chartMC.addChild(hitDot);  
var globalPos:Point = new Point(hitDot.x, hitDot.y);  
globalPos = hitDot.localToGlobal(globalPos);

trace(globalPos);

if(chartMC.ChartSection1.hitTestPoint(globalPos.x,globalPos.y,true))  
{  
myColor1 = chartMC.ChartSection1.transform.colorTransform;  
myColor1.color = parseInt(chartHitOn);  
chartMC.ChartSection1.transform.colorTransform = myColor1;  
}  
else  
{  
myColor1 = chartMC.ChartSection1.transform.colorTransform;  
myColor1.color = parseInt(chartHitOff);  
chartMC.ChartSection1.transform.colorTransform = myColor1;  
}
