Copy link to clipboard
Copied
When I need a layers opacity to turn on for a specific dropdown item I'll sometimes use this expression:
dropdown = comp("CHOOSE LOGO HERE").layer("CHOOSE LOGO HERE").effect("Choose Station Logo")("Menu"); dropdown == 1 ? 100 : 0;
However, what if I need they layer opacity to be 100 for more than one dropdown item. Say == 1, 8, 22 ?
I can't seem to figure out how to get this to work. Any help?
Copy link to clipboard
Copied
This should work:
m = thisComp.layer("CHOOSE LOGO HERE").effect("Dropdown Menu Control")("Menu");
m == 1 || m == 8 || m == 22 ? 100 : 0
Copy link to clipboard
Copied
Sorry, didn't catch that you had renamed the dropdown. This is better:
m = thisComp.layer("CHOOSE LOGO HERE").effect("Choose Station Logo")("Menu");
m == 1 || m == 8 || m== 22 ? 100 : 0
Copy link to clipboard
Copied
This works! It's crazy because I feel like i've ftried this. Is their something about "m" that makes this work? Anyways thank you!
Copy link to clipboard
Copied
No, it's just a shorter variable name than "dropdown".
Find more inspiration, events, and resources on the new Adobe Community
Explore Now