Page 1 of 1

Disabling draggable objects

PostPosted: Mon May 18, 2015 1:26 am
by Tan Teow Chye
After making an object draggable by using the function creatDraggableobject, how do I make the same object non-draggable again? I am creating a page with two objects, say A and B, and I want only one of them to be draggable at any one time. On load page, I can make A only draggable, After dragging A, I make B draggable but after this, both A and B will remain draggable.

Re: Disabling draggable objects

PostPosted: Mon May 18, 2015 1:30 pm
by Clifton
To stop an object from being dragged, just run createDraggableObject() again and set the parameter suspendDrag = true

Re: Disabling draggable objects

PostPosted: Tue May 19, 2015 12:15 am
by Tan Teow Chye
Thank you. I should have thought of that. I managed to solve the problem by disabling all the other draggable objects except the one to be dragged. Is this acceptable?

Re: Disabling draggable objects

PostPosted: Tue May 19, 2015 6:31 am
by Clifton
If it works, who am I to complain. Sounds great. The suspendDrag parameter was provided because not all objects respond to being disabled. Using the provided parameter will work in ALL cases.