Hi i'm having some dificult to stop a timer in a diferent action,
actually i have this:
Starter action:
saving object:
In other action:
the Variable temporizador is Object Type.
Thanks for your sugestions.
and camelCase :)
clearInterval, setInterval
Hi @Pedro Rocha ,
2 things : i think the identifier of the interval is just an integer, not an object.
There is a typo : you have ClearInteval instead of ClearInterval, so letter 'r' is missing.
Dorine
It was just this 2 erros... sometimes the simple makes it hard :/
I think you can avoid some extra code. Just remove output parameter from js, and use global unique variable for your timer.
Example:
window.my_fance_interval_id = setInterval( function() { /* do some work*/} );
wherever you need to stop it:
if (window.my_fance_interval_id !== undefined) { clearInterval(window.my_fance_interval_id); }
And I can see you are using actions inside your interval, so do not forget to stop it in OnDestroy event, otherwise you will get js errors complaining you are trying to execute a code that no longer exists.
Hi Pedro,
You can also use the Timing Events forge component. This contains the setInterval function and is configurable when it is active or not.
Hope this helps,
Vincent
I will explore it, Thanks!!