# Change background color of a movie clip

**URL:** <https://forum.kirupa.com/t/change-background-color-of-a-movie-clip/273136>\
**Category:** flash\
**Created:** [October 11, 2008, 9:41pm UTC](https://forum.kirupa.com/t/change-background-color-of-a-movie-clip/273136 "2008-10-11T21:41:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dc2000](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dc2000](https://forum.kirupa.com/u/dc2000)\
**Post date:** [October 11, 2008, 9:41pm UTC](https://forum.kirupa.com/t/change-background-color-of-a-movie-clip/273136/1 "2008-10-11T21:41:20Z")

</div>

Hi everyone:

I’m not new to programming, but I’m fairly new to Flash & ActionScript. Here’s my dilemma. I have a movie clip symbol that is linked to the Ball class. I need to change the color of the background fill for this movie clip. Someone on this forum suggested moving the fill to a nested movie clip and using ColorTransform on it, but I can’t make it to work.

Can someone tell me what am I not doing right?

So far, I have this:

```auto
package
{
    import flash.display.MovieClip;
    import flash.geom.ColorTransform;
    
    public class Ball extends MovieClip
    {
        function Ball(color:uint):void
        {
            var colorTransform:ColorTransform = this.transform.colorTransform;
            colorTransform.color = color;
            this.transform.colorTransform = colorTransform;
        }
    }
}

```

and from the main time line:

```auto
var ball:Ball = new Ball(0xff0000);
addChild(ball);

```
