Copy link to clipboard
Copied
I'm trying to generate random numbers every 5 seconds and to output in a dynamic text box using Animate Canvas.In the canvas, I have a dynamic text box named numberOutput.
So far, I have—
var max = 225;
var min = 70;
this.numberOutput.text=[Math.floor(Math.random() * (max - min + 1) ) + min];
This works but with no interval.
How do I put the interval so the dynamic text generates a random number every 5 seconds?
Thanks.
The scripting language for Canvas documents is JavaScript. So any basic programming questions will be JavaScript questions.
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout
Copy link to clipboard
Copied
The scripting language for Canvas documents is JavaScript. So any basic programming questions will be JavaScript questions.
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval
https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout
Find more inspiration, events, and resources on the new Adobe Community
Explore Now