# How to detect hittest here?

**URL:** https://forum.kirupa.com/t/how-to-detect-hittest-here/332145
**Category:** Uncategorized
**Created:** [February 14, 2014, 12:58pm UTC](https://forum.kirupa.com/t/how-to-detect-hittest-here/332145 "2014-02-14T12:58:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![aldo\_tanku](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@aldo\_tanku](https://forum.kirupa.com/u/aldo_tanku)
#### Post date: [February 14, 2014, 12:58pm UTC](https://forum.kirupa.com/t/how-to-detect-hittest-here/332145/1 "2014-02-14T12:58:56Z")

</div>

var curr\_box;  
var depthLevel = 3000;  
var boxCounter = 1;

function createBox()  
{  
curr\_box = cloudLayer.attachMovie(“box”, “” + boxCounter, depthLevel);  
curr\_box.\_x = 800;  
curr\_box.\_y = Math.random() \* 420;  
curr\_box.\_xscale = curr\_box.\_yscale = 90;  
curr\_box.speed = 15;  
boxCounter += 1;  
depthLevel += 1;  
curr\_box.onEnterFrame = boxMove;  
}  
function boxMove()  
{  
if (\_root.Player.hitTest(this) )  
{  
Player.visible = false;  
}
