How do I make a button only work when two imageSprites colide?

Hi,
Im trying to make a beat game and want to make the button so, that it only gives points if the beats reach the line, but i can't seem to make it work.
This is also a school project so im pretty new to this.
Thanks :smile:(Problem solved my sister helped me)

How do you match up the buttons and the sprites?

By position (xy range)?

By sprite image?

I dont match up the buttons and the sprites. I have a line on a canvas and the beats. And if the beats touch the line the button should work. Ig? Idk if thats a good way to do that.