# So easy, i can't do it - Changing object color

**URL:** https://forum.kirupa.com/t/so-easy-i-cant-do-it-changing-object-color/204855
**Category:** Uncategorized
**Created:** [October 24, 2006, 3:05am UTC](https://forum.kirupa.com/t/so-easy-i-cant-do-it-changing-object-color/204855 "2006-10-24T03:05:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![stahler](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/stahler/32/2905_2.png) [@stahler](https://forum.kirupa.com/u/stahler)
#### Post date: [October 24, 2006, 3:05am UTC](https://forum.kirupa.com/t/so-easy-i-cant-do-it-changing-object-color/204855/1 "2006-10-24T03:05:59Z")

</div>

I draw a circle on the stage.

I select it and save as symbol, i call it mc\_circle and “export to action script” as my\_mc\_cirle

I cannot get the circle to change color using what I imagine should be a 1 liner. Very frustrated

my\_mc\_circle.setRGB(0x0000CC);  
and  
mc\_circle.setRGP(0x0000CC);

are doing nothing??

---

<div class="post-metadata">

### Author: ![stahler](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/stahler/32/2905_2.png) [@stahler](https://forum.kirupa.com/u/stahler)
#### Post date: [October 24, 2006, 3:12am UTC](https://forum.kirupa.com/t/so-easy-i-cant-do-it-changing-object-color/204855/2 "2006-10-24T03:12:21Z")

</div>

i fingured out a “way” to do it. but is this the only way to do it?

```auto

import flash.geom.ColorTransform;
import flash.geom.Transform;

var colorTrans:ColorTransform = new ColorTransform();
var trans:Transform = new Transform(my_mc_circle);
trans.colorTransform = colorTrans;

colorTrans.rgb = 0x333311; // blue
trans.colorTransform = colorTrans;

```

---

<div class="post-metadata">

### Author: ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)
#### Post date: [October 24, 2006, 3:13am UTC](https://forum.kirupa.com/t/so-easy-i-cant-do-it-changing-object-color/204855/3 "2006-10-24T03:13:34Z")

</div>

Where myCircle is the instance name of your movie clip:

```auto
import flash.geom.ColorTransform;
this.tempColourTrans = new ColorTransform();
this.tempColourTrans.rgb = 0xCC;
this.myCircle.transform.colorTransform = this.tempColourTrans;
delete this.tempColourTrans;

```

or:

```auto
this.myCircle.colour = new Color(this.myCircle);
this.myCircle.colour.setRGB(0xCC);

```

The first method is reccomended.

---

<div class="post-metadata">

### Author: ![stahler](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/stahler/32/2905_2.png) [@stahler](https://forum.kirupa.com/u/stahler)
#### Post date: [October 24, 2006, 12:48pm UTC](https://forum.kirupa.com/t/so-easy-i-cant-do-it-changing-object-color/204855/4 "2006-10-24T12:48:35Z")

</div>

cool, I was looking at a tutorial here:

[http://www.kirupa.com/developer/actionscript/color.htm](http://www.kirupa.com/developer/actionscript/color.htm)

I thought that it was depriciated; then I realised it still is a kind of transform you put on a symbol instance. Not a physical property of the instance.

---

<div class="post-metadata">

### Author: ![stahler](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/stahler/32/2905_2.png) [@stahler](https://forum.kirupa.com/u/stahler)
#### Post date: [October 24, 2006, 12:58pm UTC](https://forum.kirupa.com/t/so-easy-i-cant-do-it-changing-object-color/204855/5 "2006-10-24T12:58:59Z")

</div>

cool, I was looking at a tutorial here:

[http://www.kirupa.com/developer/actionscript/color.htm](http://www.kirupa.com/developer/actionscript/color.htm)

I thought that it was depriciated; then I realised it still is a kind of transform you put on a symbol instance. Not a physical property of the instance.

---

<div class="post-metadata">

### Author: ![hetlicht](https://avatars.discourse-cdn.com/v4/letter/h/96bed5/32.png) [@hetlicht](https://forum.kirupa.com/u/hetlicht)
#### Post date: [October 24, 2006, 7:58pm UTC](https://forum.kirupa.com/t/so-easy-i-cant-do-it-changing-object-color/204855/6 "2006-10-24T19:58:11Z")

</div>

here’s the 1 liner:

my\_mycircle.colorTo(0x993333,1);

you’ll need the lacos tween class for this to work.

Cheers,

Hetlicht
