Objet color changing

Recommended Posts


I got a start and a stop button that I'd like to be changing color when pressed.

I looked at the examples available on your site but could not get it to work like i want.

In the example, the button change color while you press put then go back to it's original color.

What I want is that when everything is stop, the start button is green and stop button is grey than when you click on the start button that begins a sequence, it becomes grey and the stop button becomes red and vice versa.

Thanks in advance

Link to comment
Share on other sites

As long as you only use those buttons to start / stop the sequence, the easiest way to do this is to change the colors as part of the action of the buttons. So:

1) Name both your buttons. Select each, right click and select Component Name... I'll assume you called them StartButton and StopButton.

2) In the StartButton, go to the Action page where you probably have begin/end sequence. Select "Quick Sequence" then in the script put:


component.startbutton.backcolor = rgb(128,128,128) // grey

component.stopbutton.backcolor = rgb(255,0,0) // red

3) In the stopbutton, do the same thing essentially, but the script becomes:


component.startbutton.backcolor = rgb(0,255,0) // green

component.stopbutton.backcolor = rgb(128,128,128) // grey

You can tweak the three numbers to get any color you want.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.