# hitTestObject reference

**URL:** <https://forum.kirupa.com/t/hittestobject-reference/234062>\
**Category:** flash\
**Created:** [July 30, 2007, 7:14am UTC](https://forum.kirupa.com/t/hittestobject-reference/234062 "2007-07-30T07:14:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xEnOn](https://avatars.discourse-cdn.com/v4/letter/x/85e7bf/32.png) [@xEnOn](https://forum.kirupa.com/u/xEnOn)\
**Post date:** [July 30, 2007, 7:14am UTC](https://forum.kirupa.com/t/hittestobject-reference/234062/1 "2007-07-30T07:14:56Z")

</div>

i am having some problems with the scope of AS3 again…  
i have a movieclip, that has a linkage, that is based on a class called “Icon”.  
in this Icon.as, i have a function that is trying to accessing a movie clip call dropPanel\_mc. in this function, there is a statement that tests if the icon has hit the dropPanel\_mc. i am using hitTestObject.

however, i don’t seem to be able to get the right object reference into the parameter of hitTestObject.  
here’s what i have for the dropHandler method of the Icon class.

```auto

private function dropHandler(event.MouseEvent):void {
	this.stopDrag();
	if(this.hitTestObject(getChildByName("dropPanel"))){
		trace("correct");
	}
}

```

this doesn’t seem to work as it keeps saying that the object isn’t hit when it suppoes to hit.
