Don't reset timeSincePress!

I am struggling with how to keep the timeSincePress from resetting after it has run. I’ve seen some other postings about this, but can’t put it altogether yet. Here is the slide:

I don’t think I’ve seen a way to avoid this and this question looks like it has been presented a few times. I do have a suggestion, although it might clutter the screen.

  1. Turn the sketch into a graph and then use animationDuration to control the timer. The button can be deleted.
  2. Create another sketch screen if you want the students to draw. This isn’t necessary, but maybe you want that option.
  3. The table can be left as shown.
1 Like

Do you want your animation to always remain in the end state until the button is pressed again? Or do you want it to revert back to the beginning only after something has been changed in the table?

I wanted it to remain in the end state. cwinske’s work around, using animationDuration worked out OK, but it would be nice to have control over this in the table-- resetOnFocus: false??

Do you ever want it to reset? (Not restart, but reset back to zero and stay there until the button is pressed again)

Yea. It would be nice to reset and rerun. It works OK using animationDuration, just weird behavior (IMO) for the table to automatically reset and to not have control over it. (I am sure I am missing the reasons for why it was designed that way!)

2 Likes

Far out! These also look like they will really help me understand the history, capture, and last value functions which I have been making no headway with! TY.

1 Like