Can I trigger a specific action when one variable change the value?

I have one Custom Widget that performs some work. At a certain moment, one variable turns TRUE. I want to listen to this variable content and, when changes to TRUE, I want to trigger an action (play a sound, change the color of an icon, and change the variable to FALSE again).

Is it possible? Thanks.

5
5 replies