Activity › Forums › Adobe After Effects Expressions › If statements holding values
-
Dan Ebberts
January 8, 2016 at 11:16 amGood point. I guess that would be the case as long as the flip is instantaneous and there’s no hysteresis (up and down thresholds are the same).
Dan
-
Ymri Scheiner
January 9, 2016 at 5:03 pmThank you a lot ! I’ve tried and it works ! Just to know, what does (n%2) means ?
-
Dan Ebberts
January 9, 2016 at 6:45 pm% is the JavaScript modulus operator, which gives you the remainder of a division operation, so (n%2) will be true if n is an odd number, false if it is an even number (assuming n is an integer, as it is in this case).
Dan
-
Ymri Scheiner
January 10, 2016 at 3:45 pmOh ok but shouldn’t you put the ==0, or does it recognize you mean if this equals 0 when you put nohting ?
-
Dan Ebberts
January 10, 2016 at 5:21 pm(n%2 != 0) would give you the same result, but anything that’s not zero gets interpreted as true.
Dan
Reply to this Discussion! Login or Sign Up