Hey everyone!
I’m having an issue figuring out how to get the target of sprite when a user clicks on it.
For example, I’m doing something like this:
this.app.root.findByName('MyObject).script.sprite.on(‘click’, this.clickedObject, this);
Then the function I have would be:
MyExample.prototype.clickedObject = function(evt) {
…
}
I am passing “this” into the click call but I’m not sure how to receive it in the function. I know in other languages like AS3, I would do “evt.target” to get the object. Is there something similar here?
Thanks!