I need some actionscript code to simulate the dragging and dropping of a Sprite, I was wondering if it is possible to do so? if it is how?
For example to simulate a click on a Sprite I can achieve with the following line of code.
sprite.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
Either do something like this:
You can pass 2 arguments to the startDrag method, the first is a boolean to lock to center, the second is a Rectangle-object for boundary-points.
And for a more controlled behavior you can do something like this instead:
(haven’t tested the code so there might be some small syntax-error or something)