Delay for the color of a button

Hello everybody! I am doing a question and answer application and I am puzzled by something that seems somewhat simple.

When answering an answer I want the button pressed to keep the color red for a few seconds and then return to its original color (if the question is incorrect). on the other hand, I want the button pressed to keep the green color for a few seconds and then return to its original color (if the answer is correct).

I've been trying this but it doesn't work
boton1

It just stays white ... and what I want is this:

estado

Any way to do it? or any suggestion to do this?

Using clock component, set time interval to 2000 and when button click set timer enabled to true and then check if awnswer is correct or not. Depending the answe, change button's bg color and when clock.timer set button's bg color to original and false. If you have many buttons you can you Any components and when any button click. A simple example is shown

1 Like

Dora!
Thank you ! I can't believe there was such a simple way to do this and I didn't realize it ... thank you very much, it's already solved, it worked perfectly for me :sonrisa:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.