Highlight a Symbol Using a Button

Highlight a Symbol Using a Button

Hello,

I need help in achieving a specific task, the version am using is Version 11 Build111398 64Bit.
The problem statement is:
1) I have a custom Symbol with 2 buttons, each will open a specific window.
2) The highlight is a rectangle that will act as a background for a custom Symbol.
3) Highlight will glow on if any button of the two is pressed.
4) Highlight will glow off if both windows are closed.

What I achieved:
1) I have made an internal variable and tied it to the Visibility/Flashing option of the rectangle background.
2) There are 2 functions, Screen Switch function to open the respective window when the button is pressed and a Write/Set Value function used to change the internal variable value to 1.
3) Both functions has been added to a Script and the Script will be executed if the button is pressed. (2 Scripts for 2 buttons -each button will open a different window-).

Result:
The Symbol background glow when I press the button but it won't turn off because there is no way to detect when the specific window has been closed and write the internal variable back to 0.

I hope the problem is well defined, please let me know if more information is required. Thanks in advance.