# Changing object color with AS

**URL:** https://forum.kirupa.com/t/changing-object-color-with-as/246219
**Category:** Uncategorized
**Created:** [December 8, 2007, 6:32am UTC](https://forum.kirupa.com/t/changing-object-color-with-as/246219 "2007-12-08T06:32:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![killahert](https://avatars.discourse-cdn.com/v4/letter/k/6f9a4e/32.png) [@killahert](https://forum.kirupa.com/u/killahert)
#### Post date: [December 8, 2007, 6:32am UTC](https://forum.kirupa.com/t/changing-object-color-with-as/246219/1 "2007-12-08T06:32:04Z")

</div>

hi I am trying to make a smooth color transition using AS2

the way I have now the mc changes colors just fine, but not smooth like when you use tween. I know there is a ‘get Transform’ function but I don’t know how to apply maybe someone has an example??

```auto

function changeBG(col) {
	var c = new Color(_root.bg);
	c.setRGB(col);
}
changeBG(0xCC3366);

```
