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.

1. you are using the touch method or the tap method?
2. in the function where you handle the touch/tap, you can get

1
2
3
4
5
6
7
8
9
10
11
 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

Thanks.
Superb job.

views:1455 update:2011/9/25 12:40:18
corona forums © 2003-2011