Managing a ticker using clickable buttons in the graphing calculator

I have a ticker used to generate time in a simulation. I can stop and start it manually by clicking on the metronome icon. What I would like to do is start and stop using a clickable “Play/Pause” button. Are there commands I can put into the action field of clickable polygons to control the ticker?

You can add conditions to the ticker, and use the clickable polygon to adjust accordingly.

For instance, if your ticker was running u_pdate, you could change this to {t=1:u_pdate}, so this will only run when t=1. Then use your clickable to toggle t between 0 and 1 (eg. t->1-t) and this will essentially start and stop the ticker.

Thanks, I was hoping there was some direct control but that is a flexible approach. I’ve created a “State” variable, the “Play” button sets it to 1, “Pause” sets it to 0. The ticker runs a primary action which then calls a secondary action only if State=1 and the latter does the real work. It’s an extra couple of lines but does the job nicely.

Hello, how do you make your ticker run a primary action in the first place?