4 Replies Latest reply on Jan 21, 2009 5:20 AM by Andy Bay

    Trying to build a simple expression

    Andy Bay Level 1
      Hi!

      Here's what I'm trying to do:

      On layer 1 I have wiggle flashing the opacity of that layer.

      On layer two I have a slider linked to the frequency of the expression in layer 1.

      On the slider value property I have again wiggle so that the slider gets random values also.

      Now I would like the slider value to remain 0 most of the time. I would like it to be other than 0 only if gets a bigger value than 1. In other words if the wiggle expression gives the slider a value like 0.8 then I would like it to be 0. Only if wiggle gives the slider a value that is bigger than 1, would I like the slider to keep that actual value.

      What am I actually looking for? I'm trying to have a light sign strobe in a fast (random) frequency at a random interval. There might be a smarter way to do it, and if so, then please let me know. Even if there is a smarter way, I would be curious on how to accomplish this with an if/else expression. Here's what I tried (I'm a total newbie on expressions)

      wiggle (0.02, 2);
      if (value < 1) {

      0

      }else{ value ; }

      I know I know, it's terrible. First of all I don't know if I can even use wiggle in the beginning of an expression like that. Secondly I have no idea on what to call the slider value in this expression (I mean on the second line, where I'm trying to tell AE that if the slider is less than 1 then make it 0). And on the last line I'm trying to tell it to use the value that the wiggle feeds it (if it's bigger than 1).

      I'm sorry for asking such a question. If anyone can give me advice I will appreciate it greatly!