FORUMS: list search recent posts

Expression 'IF' with multiple "OR" Conditions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
James Parsons
Expression 'IF' with multiple "OR" Conditions
on Mar 26, 2015 at 11:12:51 am

Hi,
Can anyone help? I have an expression on my opacity layer. From a layer control in a master comp I can choose which text layer I want visible. This works really well:


$Colorsel =
comp("Edit here").layer("DROPDOWN MENU").effect("Text")("Layer");
if ($Colorsel.name == ("THURSDAY"))
{[100];} else {[0];}

However I have arranged this text in a pre comp making patterns with the text. I have varying lengths of text eg, "Now" short line and "Next Wednesday" long line. I want the same drop down menu to determine the which precomp is turned on using the same expression. I had thought adding, "||" meaning "or" might work:

$Colorsel =
comp("Edit here").layer("DROPDOWN MENU").effect("Text")("Layer");
if ($Colorsel.name == ("MONDAY") || ("TUESDAY") || ("THURSDAY") || ("SATURDAY") || ("DECEMBER"))
{[100];} else {[0];}

It doesn't throw any errors but the value of transparency is always 100 even if the String setting is not matched in the dropdown menu! it seems like it should be simple, I can't work out what I have missed.

Thanks

James Parsons


TL;DR: My "or" condition doesn't seem to work in my expression.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]