Question

The question may be a little confusing so I will try to simplify it the best I can

I have 2 movieclips on stage with instance names mc1 & mc2

The code in frame is as follows

mc1.onRelease = function() {
    col = new Color(this);
    col.setRGB(Math.random()*"0xFFFFFF");
}
mc2.onRelease = function() {
    orig_col = new Color(mc1);
    new_col = new Color(this);
    new_col.setRGB(orig_col.getRGB()*"0xFFFFFF");
}

The mc1 function is working fine(it's color is getting randomized). But when a user clicks mc2, it gets some weird color, not the color of mc1

Basically, I want when we press mc2, it's color will be what mc1's is..

Please help me fix this...

Thanks!!

Was it helpful?

Solution

This seems helpful for the script of mc2 (the script of mc1 is fine)

mc2.onRelease = function() {
    orig_col = new Color(mc1);
    new_col = new Color(this);
    full_color = "0x"+orig_col.getRGB().toString(16);
    new_col.setRGB(full_color);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top