# How do you change rgb values hexadecimal RGB values?

**URL:** <https://forum.kirupa.com/t/how-do-you-change-rgb-values-hexadecimal-rgb-values/19573>\
**Category:** Uncategorized\
**Created:** [April 29, 2003, 3:01pm UTC](https://forum.kirupa.com/t/how-do-you-change-rgb-values-hexadecimal-rgb-values/19573 "2003-04-29T15:01:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickyb62](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@rickyb62](https://forum.kirupa.com/u/rickyb62)\
**Post date:** [April 29, 2003, 3:01pm UTC](https://forum.kirupa.com/t/how-do-you-change-rgb-values-hexadecimal-rgb-values/19573/1 "2003-04-29T15:01:12Z")

</div>

how do you change rgb values hexadecimal RGB values in action script?

---

<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:** [April 29, 2003, 5:17pm UTC](https://forum.kirupa.com/t/how-do-you-change-rgb-values-hexadecimal-rgb-values/19573/2 "2003-04-29T17:17:45Z")

</div>

Create a clip on the stage any color you want (besides red because we are going to change it to red in this example). Give it the instance name “block” (no quotes). Now… add these actions to a frame on the timeline that you want the code to be activated in…

[AS]//create color object… block is the target  
var myColor = new Color(block);  
//create a variable to house the color to change to  
//use setRGB to change the color of your clip  
//0xFF0000 is the hex color for Red  
myColor.setRGB(0xFF0000);[/AS]
