# Managing a ticker using clickable buttons in the graphing calculator

**URL:** https://cl.desmos.com/t/managing-a-ticker-using-clickable-buttons-in-the-graphing-calculator/4360
**Category:** Questions
**Created:** [June 18, 2022, 8:54am UTC](https://cl.desmos.com/t/managing-a-ticker-using-clickable-buttons-in-the-graphing-calculator/4360 "2022-06-18T08:54:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![FleetFoot](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/fleetfoot/32/3750_2.png) [@FleetFoot](https://cl.desmos.com/u/FleetFoot)
#### Post date: [June 18, 2022, 8:54am UTC](https://cl.desmos.com/t/managing-a-ticker-using-clickable-buttons-in-the-graphing-calculator/4360/1 "2022-06-18T08:54:08Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![pirsquared](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@pirsquared](https://cl.desmos.com/u/pirsquared)
#### Post date: [June 18, 2022, 1:54pm UTC](https://cl.desmos.com/t/managing-a-ticker-using-clickable-buttons-in-the-graphing-calculator/4360/2 "2022-06-18T13:54:33Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![FleetFoot](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/fleetfoot/32/3750_2.png) [@FleetFoot](https://cl.desmos.com/u/FleetFoot)
#### Post date: [June 18, 2022, 4:47pm UTC](https://cl.desmos.com/t/managing-a-ticker-using-clickable-buttons-in-the-graphing-calculator/4360/3 "2022-06-18T16:47:19Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Alexander\_3691](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/alexander_3691/32/3959_2.png) [@Alexander\_3691](https://cl.desmos.com/u/Alexander_3691)
#### Post date: [September 24, 2023, 3:34am UTC](https://cl.desmos.com/t/managing-a-ticker-using-clickable-buttons-in-the-graphing-calculator/4360/4 "2023-09-24T03:34:08Z")

</div>

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