I am working on a game with colors. You got one object that gives a random color. Then you got 3 buckets for RGB and you need to mix the random given color in a new object. That works just fine. I also made a reset button, but that does not really work. If you click the reset button, it resets the right object with the random color. If you click the resetbutton again, your mixed color in the left object also resets. If you click the resetbutton, it should should reset both objects. But it it only resets the right and if you click it again the left. I really cant see an mistake of mine... so did anybody had a problem like this?
reset_button.addEventListener(MouseEvent.CLICK, reset);
function reset(event:MouseEvent):void{
kreis.transform.colorTransform = my_color;
my_color.blueOffset = 0;
my_color.greenOffset = 0;
my_color.redOffset = 0;
kreis2.transform.colorTransform = my_color2;
my_color2.blueOffset = 0;
my_color2.greenOffset = 0;
my_color2.redOffset = 0;
}