# Changing\_Colors

**URL:** <https://forum.kirupa.com/t/changing-colors/4905>\
**Category:** flash\
**Created:** [August 24, 2002, 5:36am UTC](https://forum.kirupa.com/t/changing-colors/4905 "2002-08-24T05:36:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Allen](https://forum.kirupa.com/u/Allen)\
**Post date:** [August 24, 2002, 5:36am UTC](https://forum.kirupa.com/t/changing-colors/4905/1 "2002-08-24T05:36:22Z")

</div>

This forum has been such a huge help - I appreciate everyone.

Here is an interesting question:

I have a “Closed Caption” button which is by default on or white,  
I have used the following actionscript to togle the movie clip that contains the closed captioning on and off as the user clicks the button:

on (release) {  
if (\_level1.cc.\_visible == true) {  
\_level1.cc.\_visible = false;  
} else if (\_level1.cc.\_visible == false ) {  
\_level1.cc.\_visible = true;  
}  
}

My QUESTION is I need the button color to also change from its white (on condition) to its grey (off condition) as the user clicks it similiar to the above code.  
I just cant get the coding right or not sure how to do that.

As always your help is greatly appreciated!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 24, 2002, 6:22am UTC](https://forum.kirupa.com/t/changing-colors/4905/2 "2002-08-24T06:22:42Z")

</div>

on (release) {  
if (\_level1.cc.\_visible == true) {  
\_level1.cc.\_visible = false;  
} else if (\_level1.cc.\_visible == false ) {  
\_level1.cc.\_visible = true;  
}  
}  
on (release) {  
if (myColor = 0xFFFFFF) {  
myColor = new Color(closed);  
myColor.setRGB(0x999999);  
} else if (myColor = 0x999999) {  
myColor = new Color(closed);  
myColor.setRGB(0xFFFFFF);  
}  
}

Here is my code: It toggles the Closed Captioning fine and will change the color from white to grey with the first click and stays grey.  
After when clicked a second time the closed captioning toggles again but the button remains grey and will not return to the white color???
