Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects jumping counter expression

  • jumping counter expression

    Posted by Robert Brueschke on January 26, 2006 at 9:39 am

    I need a counter which is not displaying every number he is counting, he should jump in predefined increments. For example: starting with 0, every 2 seconds the counter should count up and display 6 more (0s:0, 2s:6, 4s:12 …)
    Can anyone help me with an expression?

    Robert Brueschke replied 20 years, 3 months ago 4 Members · 7 Replies
  • 7 Replies
  • Filip Vandueren

    January 26, 2006 at 10:54 am

    Math.floor(time/2)*6;

    or:


    startTime=0;
    incTime=2;
    inc=6;

    Math.floor((time>startTime?time-startTime:0)/incTime)*inc;

  • Robert Brueschke

    January 26, 2006 at 11:23 am

    Great this works, but how can I start with a specific value in the display. If I change the start parameter nothing happens ;-(

  • Filip Vandueren

    January 26, 2006 at 2:41 pm

    That would be:


    startValue=3;
    startTime=0;
    incTime=2;
    inc=6;

    startValue + Math.floor((time>startTime?time-startTime:0)/incTime)*inc;

    startTime would be if you want the counting to begin later.

  • Dan Ebberts

    January 26, 2006 at 3:30 pm

    You’re not going to want to name a variable “startTime” because it’s already defined as the read-only start time of the layer. So you can’t change it. Not very useful as a variable. 🙂 (Learned the hard way – tough bug to find)

    Dan

  • Filip Vandueren

    January 26, 2006 at 4:58 pm

    Thanks Dan,

    didn’t test the expression… d’oh

    This will work:

    beginValue=3;
    beginTime=5;
    incTime=2;
    inc=6;

    beginValue + Math.floor((time>beginTime?time-beginTime:0)/incTime)*inc;

  • Nils Palmen

    January 26, 2006 at 5:52 pm

    sorry to hijack this thread for a second – nevermind this post people …

    Filip – i lost your email adress and wanted to ask you something through email about an expression in a project i’m making … my email is: hunimix@hotmail.com … please contact me. toedels.

  • Robert Brueschke

    January 27, 2006 at 3:04 pm

    thanks for the help, in the meantime I got it work to.
    If somebody leads yout way, it could be so esay ;-)))

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy