# Color replacement question

**URL:** <https://forum.kirupa.com/t/color-replacement-question/197336>\
**Category:** Uncategorized\
**Created:** [August 15, 2006, 6:36pm UTC](https://forum.kirupa.com/t/color-replacement-question/197336 "2006-08-15T18:36:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jabberwokky](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jabberwokky/32/1774_2.png) [@jabberwokky](https://forum.kirupa.com/u/jabberwokky)\
**Post date:** [August 15, 2006, 6:36pm UTC](https://forum.kirupa.com/t/color-replacement-question/197336/1 "2006-08-15T18:36:06Z")

</div>

ive been trying to get this idea working and so far have made a bit of headway. but im running into some problems.

[movie can be viewed here](http://elbandersnatcho.com/flash/test-1.swf)

my code for the color swatch is this;

```auto

on (release) {
    var colorful = new Color("_root.trim");
    colorful.setRGB(0x789EF5);
    with (_root.trim) {
        _alpha = 50;
    }
    var colorful = new Color("_root.leftwall");
    colorful.setRGB(0x1F327A);
    with (_root.leftwall) {
        _alpha = 50;
    }
    var colorful = new Color("_root.rightwall");
    colorful.setRGB(0x9228AC);
    with (_root.rightwall) {
        _alpha = 50;
    }
}

```

I’d imagine this is pretty sloppy, but im pretty new at this. what im trying to do is have several pallets, with different color variations, apply those colours to a mask i have over this image. I did try to have this image and mask in its own movie clip, but then the colours stop loading if i do that.

Is there a simpler, or better way of accomplishing this? I thought about arrays, but I’m not sure.

Cheers
