Initializing x,y position of an object on click event

Hi,
I am developing a apps. In my apps I am storing 10 position in an array and assigning that position randomly to 10 object.When I am clicking on particular object then I am getting name of the object but I also want x,y position of that object.
For this I passed x,y as parameter on click event but it’s displaying error.
If any idea please advice with an example.

Thanks.
[import]uid: 75428 topic_id: 15095 reply_id: 315095[/import]

  1. you are using the touch method or the tap method?
  2. in the function where you handle the touch/tap, you can get
 local function onTouch(event)  
 local target = event.target  
 local x = target.x  
 local y = target.y  
 local phase = event.phase  
  
 if "began" == phase then  
 print("touched the object ",target)  
 print("at x:" .. x .. ", y:" .. y)  
 end  
 end  

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 15095 reply_id: 55850[/import]

Thanks.
Superb job. [import]uid: 75428 topic_id: 15095 reply_id: 55863[/import]