Need Help with IF/ELSE Errors
Short version, I want the fill color of a shape to change based on the value of a number on another layer. There are a total of three colors I want it to be ready to take, but try as I might I can't get the expression part to work. I've got the colors set up in a master template, so that part's easy; now I need to figure out the IF/ELSE part to get it to actually evaluate the number.
temp1 = thisComp.layer("Temperature").effect("Temperature")("Slider");
temp2 = thisComp.layer("Temperature").effect("Warning Max")("Slider");
temp3 = thisComp.layer("Temperature").effect("Warning Min")("Slider");
temp4 = thisComp.layer("Temperature").effect("Average")("Slider");
if (temp1 <= temp2 || temp1 >= temp3) { 100 }
else if (temp1 > temp4) { 150 };
else if (temp1 < temp4) { 250 };
Basically, if the value of temp1 is outside the range specified by temp2 and temp3 (greater than or equal to or less than or equal to the appropriate value), I want the box to turn one color (represented here by the numeral "100" but I'll change that to point to the template's fill color).
If it isn't but it's above the value of temp4, I want the box to turn a different color (represented by "150"), and if it isn't but it's below the value of temp4, I want it to turn a third color (represented by "250").
The numerals here are because I've got this on a slider that I'm using to test this out. The problem is, I'm getting an error, "Unexpected token 'else' " so something about this syntax is wrong, but I can't figure out what I'm doing wrong.
Can anybody help me fix it?
