The expression 1 - Sprite1.AnimationFrame
If the animation frame is currently 0, then 1 - 0 = 1 and so the frame will change to 1 (checked)
If the animation frame is currently 1, then 1 - 1 = 0 and so the frame will change to 0 (unchecked)
As you saw I made the 2 states as frames in the one sprite rather than 2 sprites, and turned animationspeed to 0 in properties, so they didn't animate between the frames when we didn't want them to.
You can add an instance variable to track state (checked/unchecked) or just continue to use 'Sprite1.AnimationFrame'. If the latter, I suggest you create 2 constant global variables
UNCHECKED = 0
CHECKED = 1
and use those instead of 0 and 1