Blinking off on normal state


(Manolo) #1

Hello, I adapt this JS from this forum, after the user press the “ON” button it will start blinking the three Rectangles Elements. It starts as white and blink to Black, but sometimes when the button is set to “OFF” the rectangles stops in Black color, is there a way to make it
stop in white, I understand is a timer but when the button is “OFF” the color should be white.
Thanks in advance.
StrobLights.hype.zip (31.8 KB)


#2

@manolo

Add the (2) lines of code just below to each of the “myStopFunctions” for each strobe:

 var strobeWhite =  hypeDocument.getElementById('StrobLeft');
 strobeWhite.style.backgroundColor = "rgb(255, 250, 250)";

Make sure You use the correct ID for each strobe. The examples above uses the ID for the “Left” strobe.

Example Code for “Left” strobe:

function myStopFunctionL() {
   clearInterval( window.theTimerL);
   var strobeWhite =  hypeDocument.getElementById('StrobLeft');
   strobeWhite.style.backgroundColor = "rgb(255, 250, 250)";
}

(Manolo) #3

@JimScott Works the way I need, Thanks you very much.