PDA

View Full Version : Color Object



grandsp5
August 13th, 2003, 05:20 PM
can anyone tell me why this isnt working?

colors = new Color(line0);
colors.setRGB(0xFF0000);
for (k=1; k<=9; k++) {
"colors"+k = new Color(line+k);
this[colors+k].setRGB(0xFFFFFF);
mc = line0.duplicateMovieClip("line"+k, k);
mc._rotation = this["line"+(k-1)]._rotation+10;
mc._x = this["line"+(k-1)]._x+15;
}


It is supposed to set all the duplicated movie clips to the color FFFFFF. And no I can't do it later because eventually I want each one to be a progressive shade lighter of the same color. For example, line1 is FFFFFF, line 2 is EEEEEE etc so I cant set them all to once color object.

kode
August 13th, 2003, 05:33 PM
colors = new Color(line0);
colors.setRGB(0xFF0000);
for (k=1; k<=9; k++) {
mc = line0.duplicateMovieClip("line"+k, k);
mc._rotation = this["line"+(k-1)]._rotation+10;
mc._x = this["line"+(k-1)]._x+15;
this["colors"+k] = new Color(mc);
this["colors"+k].setRGB(0xFFFFFF);
}
??

grandsp5
August 13th, 2003, 05:34 PM
-smacks head- duh that was an obvious mistake. sadly it still doesnt work. Im pretty sure something is wrong with the color lines in the for loop, either syntax or data type wise.

kode
August 13th, 2003, 05:37 PM
OK... the code works. What do you want to do exactly? :-\

grandsp5
August 13th, 2003, 05:53 PM
i got it :). It was supposed to generate not random colors but progressive colors. Here is the code I ended up using:

for (k=1; k<=40; k++) {
mc = line0.duplicateMovieClip("line"+k, k);
myColor = Math.round( hex*0xFFFFFF );
pink = new Color("line"+k);
pink.setRGB(myColor);
mc._rotation = this["line"+(k-1)]._rotation+10;
mc._x = this["line"+(k-1)]._x+spacing;
hex += .0001
}

kode
August 13th, 2003, 06:04 PM
Oh!! I didn't read that in your first reply. :P

grandsp5
August 13th, 2003, 06:04 PM
Oh and here is the fla in case you were wondering what the heck I was doing. (I was wasting time at work). missed a bit huh :) oops.

grandsp5
August 13th, 2003, 06:29 PM
Hey kax, you are 366 days older than me. March 6 is my bday