mardi 20 novembre 2018

Set interval with random numbers in Adobe Animate cc

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.




Aucun commentaire:

Enregistrer un commentaire