Question about event.id Example from your docs

http://docs.coronalabs.com/api/event/touch/id.html

You are assigning the image to the reserved word object.  So, that implies only 1 can be done right?

What if I wanted 2 balls on the screen?  It appears I have problems unless I can do something like this…

local object pic1 = display.newImage( “ball.png” )

local object pic2 = display.newImage( “ball2.png” )

Then make functions like

function pic1:touch( event )

end

function pic2:touch( event )

end

Can I do that?  If not, then how can you handle multiple pics?

Sorry for the multiple simple questions, I am just trying to learn as fast as possible and I have VERY limited experience with methods and classes and such.  I am a C/Pro*C/Unix programmer trying to pic up new trade.

Thanks for all the help you can give me.

Thanks!

Hi @universalenglishinchina,

Can you be a little more specific on what you want to do? Do you want to use multitouch, where the user can touch both “pic” objects at the same time, and manipulate them separately? If so, you should start with the tap/touch/multitouch guide here:

http://docs.coronalabs.com/guide/events/touchMultitouch/index.html

Take care,

Brent

Thanks, you sort of answered it when you asked the question " … at the same time." (which is what I don’t want to do, because I don’t know how that is possible)

So if I have 2 pictures and if I want to do multitouch with both of them (but not at same time) then I need the listener to get notified about the tapping then I can find out which picture was tapped by using the event.target.  Right?

This prevents me from having to write 10 functions if I have 10 pictures and I want to do multitouch for all 10.  I can just find out which one I touched then do whatever I need to do for that picture I touched.

Thank you for your help.

Hi @universalenglishinchina,

Can you be a little more specific on what you want to do? Do you want to use multitouch, where the user can touch both “pic” objects at the same time, and manipulate them separately? If so, you should start with the tap/touch/multitouch guide here:

http://docs.coronalabs.com/guide/events/touchMultitouch/index.html

Take care,

Brent

Thanks, you sort of answered it when you asked the question " … at the same time." (which is what I don’t want to do, because I don’t know how that is possible)

So if I have 2 pictures and if I want to do multitouch with both of them (but not at same time) then I need the listener to get notified about the tapping then I can find out which picture was tapped by using the event.target.  Right?

This prevents me from having to write 10 functions if I have 10 pictures and I want to do multitouch for all 10.  I can just find out which one I touched then do whatever I need to do for that picture I touched.

Thank you for your help.