Determine which child object in display group triggered event?

In this code, is it possible to determine which child object of the myGroup display group was tapped?

[lua]local circle1 = display.newCircle(100, 100, 30)

local circle2 = display.newCircle(200, 100, 30)

local myGroup = display.newGroup()

myGroup:insert(circle1)

myGroup:insert(circle2)

function myGroupTapped(event)

    – Can I determine which display group child object was tapped here?

    transition.to(myGroup, {x = myGroup.x + 100, y = myGroup.y + 100})

end

myGroup:addEventListener(“tap”, myGroupTapped)[/lua]

Yes - inside your event handler, event.target will be a reference to the tapped object.

Actualy the event.target will be the group. The only way you can know which object in the group was tapped is if you add the tap event listener to the objects themselves and not the group. In that case you will get the object in event.target. Or you can read the event.x, event.y and figure out which item (if any) was tapped.

Yes - inside your event handler, event.target will be a reference to the tapped object.

Actualy the event.target will be the group. The only way you can know which object in the group was tapped is if you add the tap event listener to the objects themselves and not the group. In that case you will get the object in event.target. Or you can read the event.x, event.y and figure out which item (if any) was tapped.