Hey,
i have tried several things, but nothing really works. Hopefully one of you know the answer :)
Situation: I do have a grid of images, and i can "mark" this images via a click. Now i wanna:
(if i marked one and start a drag)
- create a icon on the touchstart position
- possible to drag this icon to another position( eg. top "drop" it over a button)
So i don't wanna move the image itself. I am using this for a beginning, but it's not working - really...
function onTouchStart(e) { console.log("Touch Start"); dragObject = Titanium.UI.createView({ width : 35, height : 35, backgroundColor : '#ff00ff' }); $.win.add(dragObject); dragObject.addEventListener('touchmove', onTouchMove); } function onTouchMove(e) { dragObject.left = e.x + dragObject.animatedCenter.x; }
My conceptproblem is: The dragobject should be created on touchstart, but the touchmove should be register on the object, not the image that triggered the touchstart event.
Any idea?
( Only ios7, SDK 3.2)