Hi,
I have a function setup that is similar to the basic object drag function - https://coronalabs.com/blog/2011/09/24/tutorial-how-to-drag-objects/
It works fine if it is set with the addeventlistener assigned to an object. However I want to move the object by dragging anywhere on the screen. So essentially the object will mirror your touch and drag anywhere on the screen. But I keep getting an error saying that event.target is a nil value. I have set it up as runtime:addeventlistener () given that it’s not an object that I am clicking on… Can that still work?
Also, I notice in the example given that they refer to self.markX. I gather markX is just a variable? But they don’t define it anywhere prior. I had to create markX as a local variable to get it to work. I gather in this example using self or event.target doesn’t make any difference?
Thank you to those that take the time to respond.