# Changing color trouble

**URL:** <https://forum.kirupa.com/t/changing-color-trouble/121032>\
**Category:** Uncategorized\
**Created:** [August 30, 2004, 10:50am UTC](https://forum.kirupa.com/t/changing-color-trouble/121032 "2004-08-30T10:50:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![headznet](https://avatars.discourse-cdn.com/v4/letter/h/34f0e0/32.png) [@headznet](https://forum.kirupa.com/u/headznet)\
**Post date:** [August 30, 2004, 10:50am UTC](https://forum.kirupa.com/t/changing-color-trouble/121032/1 "2004-08-30T10:50:49Z")

</div>

I have a clip in my movie that changes colors randomly every timre it is loaded.  
hers the code:

MovieClip.prototype.randomColor = function() {  
var r = Math.floor(Math.random()\*255)+1;  
var g = Math.floor(Math.random()\*255)+1;  
var b = Math.floor(Math.random()\*255)+1;  
var c = new Color(this);  
c.setRGB(r \<\< 16 | g \<\< 8 | b);  
};

The problem is there are other movieclips I need to change to the same color.  
Heres the script I’m trying to do:

MovieClip.prototype.allSameColor = function() {  
getcolor = myColor.getRGB(the\_mc)  
myColor = new Color(this);  
myColor.setRGB(getcolor);  
};
