FORUMS: list search recent posts

if/else expression depending on whether a value is growing or shrinking

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Gerard Bowden
if/else expression depending on whether a value is growing or shrinking
on Mar 11, 2014 at 9:32:53 pm

is it possible to use whether a value is going up or down to control an if/else expression?

for instance, I have a slider and i want to make it where if the slider is moving up/positive then use expression x otherwise use expression y.

ifthisistrue = Slider is moving up;

thishappens = x;

otherwisethishappens = y;


if (ifthisistrue)
{
   thishappens;
}

else
{
otherwisethishappens;
}



Return to posts index


Dan Ebberts
Re: if/else expression depending on whether a value is growing or shrinking
on Mar 11, 2014 at 10:50:58 pm

It would be like this:

s = effect("Slider Control")("Slider").speed;
if (s > 0){
// going up
}else if (s < 0){
// going down
}else{
// not moving
}


Dan



Return to posts index

Gerard Bowden
Re: if/else expression depending on whether a value is growing or shrinking
on Mar 12, 2014 at 6:56:12 pm
Last Edited By Gerard Bowden on Mar 12, 2014 at 6:56:40 pm

Thanks, works great. I really appreciate it.


Return to posts index

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