# hitTest with Lines

**URL:** https://forum.kirupa.com/t/hittest-with-lines/150585
**Category:** flash
**Created:** [June 8, 2005, 11:46pm UTC](https://forum.kirupa.com/t/hittest-with-lines/150585 "2005-06-08T23:46:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 8, 2005, 11:46pm UTC](https://forum.kirupa.com/t/hittest-with-lines/150585/1 "2005-06-08T23:46:38Z")

</div>

Hey everyone,  
I’ve realized after a few hours of fiddling around that a regular hitTest will not work properly for lines drawn via AS. I referred to the following resources first: [http://www.kirupa.com/developer/actionscript/advanced\_collision.htm and [url=“http://www.kirupa.com/forum/showthread.php?t=77513”]http://www.kirupa.com/forum/showthread.php?t=77513](http://www.kirupa.com/developer/actionscript/advanced_collision.htm)

Here is a crude example I made: [**http://www.kirupa.com/temp/hitTest.html** (\*\*[u][url=“http://www.kirupa.com/temp/hitTest.fla”]FLA](http://www.kirupa.com/temp/hitTest.html)[/u]\*\*) As expected, when the circle movie clip is dragged even close to the “rectangle” (as opposed to the line), the hitTest function returns a true as demonstrated by the transparency effect on the circle.

I’m wondering if there is a better way of creating a hitTest for the line without using numerous movie clips and a **for** loop to cycle through the movie clips.

Thanks!  
Kirupa =)
