I’m trying to make a number of different rectangles flash to a different color every .5 seconds. I’m trying to just run a different timeline and setting color changes but it is 1) not working and 2) frustrating. Every time the timeline with the color changes runs all of the rectangles change color at the same time.
Is there some other simpler way to do this via javascript that I am missing?
Not sure I understand exactly, but I did the first three rectangles with a middle point (keyframe) in the blink timeline for each element to change the bg color then back to its original color, then go to the next rect and so on…
When the button is clicked it runs the code once and then a timeline which we use as the 5 second timer. ( Mor simpler than using a JS setInterval().
The Change colour function then runs every 5 seconds and randomly change all the colours. All the Rects have the same class name which is used in the function to id them.
Well, I anticipate having this function for different tempos on different scenes. Therefore the flashes do not need to fade from one to the next but instead be more like a metronome. Currently, the flash works great but it happens so quickly that it is a bit hard to see.