Setting such a simple thing every tick is not a very good way of doing it.
You should do something like:
on click
-- mouse is over sprite ---> set cursor frame to id
--else --> set cursor frame to 0
There is no need for an every tick event here and you should avoid using those events as much as possible and just use it when you have to.