I want to have a button so when it is pressed it toggles the checked flag and have an event that when the checked flag is checked then an animation starts and runs continuously until I click the button again which would toggle the checked state to unchecked and stop the animation.
What have you tried so far?
Looking thru the event settings there is nothing for stopping an animation.
At this moment you can do it only with custom event handlers. I created a project which shows how to do it. The magic is in anim_while_checked_events.py.
Project from ZIP file should work in SLS as is it shown here or we should use it with some simulator? If I import this project and try to run it, I get this error: