Fedor Posted March 14, 2018 Share Posted March 14, 2018 When I attach an event to a sprite, like sprint.on('click',clickresponse) I would like to know which of the hundreds of sprites fired this event. But somehow the event does not contain a pointer to the sprite that fired the event. I would have thought currentTarget would be a good candidate to test for it, but that one seems to be null allways. How to figure this out? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 14, 2018 Share Posted March 14, 2018 Its in "this". Fedor 1 Quote Link to comment Share on other sites More sharing options...
Fedor Posted March 15, 2018 Author Share Posted March 15, 2018 Great, that just works... I've seen a lot of answers out there that were a lot longer and did not work... ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.