Copy link to clipboard
Copied
Hey I'm trying to use a comp name to determine the opacity of a certain layer using expressions and I can't get it to work! I'm still very new to expressions and javascript, I was wondering if someone here might know the answer...
My code:
Under Checkbox:
on = effect("Checkbox Control")("Checkbox");
compName = comp("nbc. new year's eve").name;
compStation = compName.substring(0, ".");
n = "nbc"
if (compStation == n) {
on == 1;
} else {
on == 0;
}
Under Opacity:
visibility = effect("Checkbox Control")("Checkbox");
if (visibility == 0) { opacity = 100; } else {opacity = 0;}
Copy link to clipboard
Copied
111792 wrote
on == 1;
} else {
on == 0;
}
I don't know much about coding but I can tell you that your "==" operators in these two lines is wrong.
They should be single "=".
Double equals compares or querys values.
Single equals set value.
Copy link to clipboard
Copied
As Gutter-Fish said, you are using the logic operator ==, not the assignment operator = .
Mylenium