I do not understand this specific example. I have variable names in a property Lead1, Lead2, Lead3 that are loaded from a color expression control. I then want my color to be one of those color control objects’ colors. A simple solution for me was to pick a random number between 1 and 6, and concatenate that number to the main variable name “Lead” and get …Lead5, which then in the final line of code gives the color. But I keep getting errors.
Defy1=thisComp.layer(“Colors”).effect(“Lead1”)(“Color”);
Defy2=thisComp.layer(“Colors”).effect(“Lead2”)(“Color”);
Defy3=thisComp.layer(“Colors”).effect(“Lead3”)(“Color”);
Defy4=thisComp.layer(“Colors”).effect(“Lead4”)(“Color”);
Defy5=thisComp.layer(“Colors”).effect(“Lead5”)(“Color”);
Defy6=thisComp.layer(“Colors”).effect(“Lead6”)(“Color”);
seedRandom(thisComp.layer(“Variables”).effect(“ParColorSeed”)(“Slider”),true);
ColorPic=random(1,6);
“Defy”+ColorPic //(also tried [“Defy”+ColorPic] with and without the quotes.
Is there a way to call the value of the concatenated variable name?
Thank you so much.
Roger Eaton