Because the onRelease/onPress handlers forward the touch-event, which according to the doc has the following id attribute:
event.id is a unique identifier of the chosen touch so that you can distinguish between multiple touches across events (i.e. the different events sent across multiple listener calls). The id uniquely identifies a given finger touching the screen as that touch changes state, generating new touch events.
The onEvent handler, however, manufactures its own event structure and there the event.id is a copy of your params.id.
There is also no way to get to the target-object from the event that is passed thru onRelease/onPress/onEvent, which is very inconvenient. Furthermore, the event structures are very different,
No idea what the deeper philosophical reasons are between these inconsistent event-models…
I ended-up adding an event.target attribute in the touch event-handler to all onRelease/onPress/onEvent handlers such that I can easily get to all the target, i.e. the button, attributes, like id/_id.
-FrankS.
[import]uid: 8093 topic_id: 10199 reply_id: 37235[/import]