# hitTest()

**URL:** <https://forum.kirupa.com/t/hittest/224940>\
**Category:** flash\
**Created:** [May 7, 2007, 1:01pm UTC](https://forum.kirupa.com/t/hittest/224940 "2007-05-07T13:01:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terry\_elekes](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@Terry\_elekes](https://forum.kirupa.com/u/Terry_elekes)\
**Post date:** [May 7, 2007, 1:01pm UTC](https://forum.kirupa.com/t/hittest/224940/1 "2007-05-07T13:01:06Z")

</div>

I was just playing around with the hitTest and was wondering if I could get some help on what I am doing wrong. What I am trying to do is when one moviclip rolls over the other I wanted the output to trace “hit”. Also what would I have to do to get this to work on a mouse click instead of a roll over.  
startDrag("/Target", true, 0, 0, 400, 300);  
setProperty("/VLine", \_x, getProperty("/Target", \_x));  
setProperty("/HLine", \_y, getProperty("/Target", \_y));  
ball.\_y +=2;  
function collide(){  
if (Target.hitTest(ball),true) {  
trace(hit);  
}  
}

collide();

What I was trying to do is when on moviclip rolled over the other I wanted the output to trace “hit” Also how can I get it do the same trace on a mouse clik instead of a rollover.
