# \[AS3\]Using a non rectangular drag boundary

**URL:** <https://forum.kirupa.com/t/as3-using-a-non-rectangular-drag-boundary/213159>\
**Category:** Uncategorized\
**Created:** [January 17, 2007, 11:24am UTC](https://forum.kirupa.com/t/as3-using-a-non-rectangular-drag-boundary/213159 "2007-01-17T11:24:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomp](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tomp/32/3193_2.png) [@tomp](https://forum.kirupa.com/u/tomp)\
**Post date:** [January 17, 2007, 11:24am UTC](https://forum.kirupa.com/t/as3-using-a-non-rectangular-drag-boundary/213159/1 "2007-01-17T11:24:29Z")

</div>

How would you do it?  
To clarify …  
When you call startDrag on a Sprite/MovieClip/whatever, you can specify a rectangle which the object in question will stay within.

Eg… startDrag(false, rect1);  
where rect1 is of type :Rectangle

My question is; does anyone have any idea how you would go about constraining the dragging to an arbitrary shape, say a triangle or a circle rather than a rectangle?

I figure I could just have a Timer calling a function to check the whole time but that doesn’t seem particularly nice.

Anyway, thanks in advance.
