Skip to main content
melcan8
Participant
May 25, 2022
Question

How to interrupt Delay once it starts in Advanced Actions

  • May 25, 2022
  • 2 replies
  • 286 views

This Advanced Action:

 

Assign v_hint with 0

If v_hint = 0
  then 
     Delay 5 seconds
     Show img_01

 

This AA is applied when entering a slide and works as intended. However, if the v_hint value changes to 1 before 5 seconds has elapsed, img_01 still appears anyway.  This makes sense since once the AA is triggered, the Delay action will begin immediately and can't be stopped, as far as I can tell, even if that v_hint value changes.

 

I solved my problem in an enirely different way but would still be interested in any ideas out there about ways to control the Delay action.

 

Thanks!

Thanks!

 

 

This topic has been closed for replies.

2 replies

Stagprime2687219
Legend
May 25, 2022

How about this JavaScript approach? I suppose this could be crafted with advanced actions as well - I just function in the JavaScript world.

You could place something like this on a button to execute the 5 second countdown.

At the end of 5 seconds, the variable is checked. If 0 - show it. Otherwise - nothing.

That way - whatever other mechanism you have for changing the value of your variable won't matter.

This could easily grow to accommodate more requirements.

setTimeout(function() {
if (v_hint == 0) {
cp.show("myImage");
}
}, 5000);

 

melcan8
melcan8Author
Participant
May 26, 2022

Thanks for the javascript idea. I'll play with that.

Lilybiri
Legend
May 25, 2022

Indeed the Delay command will not bother about pausing points neither. For that reason it needs to be used with much care. I found that a combination with a non-infinite While loop works well. For your use case, I would need more information about the precise goal. How can the variable be changed before the delay time elapses?

melcan8
melcan8Author
Participant
May 26, 2022

Oh, I forgot about the while loop, even though I used it for this sort of thing before. The v_hint variable is incremented by 1 when one of two click boxes is clicked. One on those click boxes fills the whole frame. 

I think using the while loop might help with this, right?