How to make flashlight follow an object ?

Hi,

So I wanted to make flashlight as one of those in samples but I wanted it to follow my object(ball) not the finger. I have no idea how I would make it. I was modifing the code but I mostly got errors.

In sample there is only 1 image so would it work if I have more objects(images)?

Thanks!