0
votes

I Try to drag component using DragManager but it will not drag my component live. it will drag like given image below.

enter image description here

But i don't want to drag compoenent like this.

So, I will try to drag component by changing it's X Position. I will change it's X Position when i drag Component using mouse, for that i use MouseDown, MouseMove and MouseUp event. OnMouseUp I put that component at that place when MouseUp event call.

But, It didn't work smooth. I use event.updateAfterEvent(); for smooth move but still didn't get good output. The Component will jurk some times when i move and some times move go outside screen and component stick to mouse.

Is Live Drag Possible in flex? I Like to use drag component functionality in mobile application.

Thanks

1

1 Answers

2
votes

Simply use "startDrag" and "stopDrag" function for your object.

On the "On Mouse Down" Event:

yourObject.startDrag();

And "On Mouse Up" Event:

yourObject.stopDrag();

For keeping the object inside specific bounds you can pass a Rectangle Object as parameter to the startDrag call:

yourObject.startDrag(false, new Rectangle(0, 0, stage.stageWidth, stage.stageHeight));

Above call will keep your object on the stage.