1 person found this helpful
Try using e.currentTarget instead of e.target. You might just be moving the innards of myImage and not myImage itself.
Thanks Ned, this helps with the tracing of the coordinates but does not change the issue that x and y re-assigning is not sufficient to move the image after dragging.
I changed the function's code to:
trace ("touch BEGIN X: "+e.currentTarget.x + " Y: "+e.currentTarget.y);
and now the trace gives the correct values (x and y on the screen)
However, when dragging is over, a button is clicked and these actions (x and y re-assignment) are performed, there is no change in the image's position
x and y positioning works perfectly if the image has been moved on the screen by some other method that is not startTouchDrag / stopTouchDrag
apparently, before being able to change x and y of an image that has been dragged, some method of the same image must be called?
OK now I understand what was wrong...
And am very ashamed.
the button and image were very close.
I have big hands. when i clicked on the button, i also touched the image,which went into drag mode
and - when in drag mode - can't be repositioned by changing x and y...
sorry and thanks for inspiration!