How to change the state of an object at the end of a slide

Hi, I have a Next button in the slide and I want that button to change state when the slide has reached its end to let the user know that they have to now click the button to move forward. How can i do that

There may be some other ways to do this but here is one that should work.

We can execute a JavaScript Action on slideLoad.

// The timeout function will fire after the 
// indicated time which is 2500ms
setTimeout(function() {
prez.object("myButton").state("myState");
},2500);

There are three items to modify.

  1. The name of the button
  2. The timing of the state change
  3. The name of your state

Another option is to also disable the button on slideLoad so that it cannot be clicked early.
Then simply enable it at your timing.

Just a thought - feel free to ask questions if you want to pursue this option.

Hi @ame,

In this case, displaying the Next button when the slide nearly reaches its end by adjusting the button’s start time will be more synchronized than showing it from the beginning and then changing its state.

Or, you can refer to Greg’s solution.

Best regards,

Thank you Greg & Hang, Both of your solutions work. However, my issue is that i have nearly 100+ slides from multiple presentations and the video location on each slide is different. If we have a feature like “on ended” for all objects. What I am trying to do here is to give the user a visual clue without their interaction when they have gone through the different sections of the slide. But for now, I will work with your suggestions.

1 Like

Hi @ame ,

I agree that we need some “onEnded” events added to objects.

However, here is a trick that someone from this forum gave me previously.

Drop an Animated Timer object into the project, but off-canvas so it isn’t seen. Synchronize the end of the timer with the time you want the event to happen in the timeline and then use the timer’s “On Timer Complete” event to change the state of the button.

HTH,
Keith