5 Replies Latest reply on Nov 20, 2012 7:30 AM by resdesign

# How to restrain the drag to an arc

Does anyone knows how I could restrain the drag position of a point to an arc.
Here is what I am trying to do. I want the student to be able to drag the green dot between point A and B and display the  value of  the resulting angle AOB.  (O is the red dot).

• ###### 1. Re: How to restrain the drag to an arc

What if you offset the center point of the green dot artwork to the place where the red dot is? Then. instead of moving the green dot, you rotate the div. (Doing it this way I think you actually get the angle calculated for "free".)

• ###### 2. Re: How to restrain the drag to an arc

Hi!

Take a loook at this topic - about the circular dragging - I opened and Tim resolved: http://forums.adobe.com/message/4811284#4811284. You can find there also the project files!

Have a nice day!

Davide

• ###### 3. Re: How to restrain the drag to an arc

Thank you both for your input. I will work on that today and will try to post my files when I am done in order to help anyone who want to do something similar - that is if I get it to work as I want.

• ###### 4. Re: How to restrain the drag to an arc

Hi Jerry,

OK. I offseted the center point and it works great in dev in EA - I mean that when I drag the green dot it does rotate on the arc. However with draggable, there are 3 possibilities:

1. non restrain on x or y - the green dot can be dragged in any direction and does not stay on the arc
2. restrain on x -  expected - the dot is limited to x (straight line left and right )
3. restrain on y - expected - the dot is limited to y (straight line up and down)

I posted a question on jqueryUI and we will see if they find a way there!

• ###### 5. Re: How to restrain the drag to an arc

Tim's example on the link provided by Davide is perfect!

Thanks guys.