# Dynamic line drawing only right angles

**URL:** <https://forum.kirupa.com/t/dynamic-line-drawing-only-right-angles/185042>\
**Category:** flash\
**Created:** [April 10, 2006, 2:29pm UTC](https://forum.kirupa.com/t/dynamic-line-drawing-only-right-angles/185042 "2006-04-10T14:29:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zooey74](https://avatars.discourse-cdn.com/v4/letter/z/a9a28c/32.png) [@zooey74](https://forum.kirupa.com/u/zooey74)\
**Post date:** [April 10, 2006, 2:29pm UTC](https://forum.kirupa.com/t/dynamic-line-drawing-only-right-angles/185042/1 "2006-04-10T14:29:34Z")

</div>

I’ve got a grid of boxes and I need to draw a line from one point to another when one of the boxes is selected. I can get this to work but the line draws through the other boxes. I need it to draw lines on certain paths where it doesn’t go over the boxes.

Here are some pics of what I’m trying to do.

![](http://clevercircles.com/yes.jpg)

![](http://clevercircles.com/no.jpg)

I don’t really know how to even approach this. I’ve used the hitTest method for certain things, but how do I tell the line to go the way I want it once it “hits” one of the boxes?

Any suggestions on how to tackle this?
