-
Script works fine as solo composition, but syntax error when imported to project
I have this script that I’m using to control the color of multiple shapes in one composition. It’s connected to a slider, so I can use the slider to change a set of predetermined colors of all shapes that should be that color.
So, for example, I have a bunch of text on a colored background and I want to use the slider to change the color of all the background shapes.
This is my expression for the slider:
slider = Math.round(thisComp.layer(“Color”).effect(“Slider Control”)(“Slider”));
which is followed by this for each color:
colorValue1 = thisComp.layer(“Color”).effect(“Color Control”)(“Color”);
if(slider==1){colorValue1};
It works beautifully in a solo composition, BUT when I import this composition into another, I get the following error on the first line:
Error: Undefined value used in expression (could be an out of range array subscript?)
Does anyone know why this error happens?
Thanks!