2 Replies Latest reply on Jul 20, 2008 3:58 PM by A. Cobb

    expression help needed - control speed of a pan via a slider

    David Wigforss-Hv1BNN Level 2
      I've done this in the past but can't locate my old project, and my head is throbbing from last nite.....

      I'd like to apply an expression to my null's position. I want it to pan horizontally at a speed specified with a slider control. I'd like it to be able to start, stop, and then continue. Doesn't need to ease in, but it'd be nice.

      Speed = effect("Speed")("Slider");
      OffsetX = effect("Offset")("Point")[0];
      fps = 24;
      x = OffsetX - (Speed * time * fps);
      [x,243]

      My problem multiplying "speed" with time means that when it stops (speed=0), it returns to the start position.... I need it to stay in place, and then continue when I animate the speed value back up.

      Please help my hungover brain....