Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Yes, another countdown question…

  • Yes, another countdown question…

    Posted by Henry Gretzinger on February 28, 2008 at 7:40 pm

    I’m an absolute beginner when it comes to expression usage (read: I know nothing about expressions). What I need to do is count down from 10 million to 2,976,302 (for instance) within a set time period. It’s okay if the countdown begins at the start of the text layer, but I need it to finish in a finite period of time (let’s say 2 seconds @ 23.98 = 48 frames). Can anyone help? Thanks in advance!

    Henry

    Henry Gretzinger replied 18 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 28, 2008 at 8:51 pm

    If you need commas, this should work:

    beginCount = 10000000;
    endCount = 2976302;
    dur = 2;

    t = time – inPoint;
    s = “” + Math.round(linear (t, 0, dur, beginCount, endCount));

    outStr = s.substr(-s.length, (s.length-1)%3 +1);
    for (i = Math.floor((s.length-1)/3); i > 0; i–){
    outStr += “,” + s.substr(-i*3,3);
    }
    outStr

    If not, just use the first part:

    beginCount = 10000000;
    endCount = 2976302;
    dur = 2;

    t = time – inPoint;
    s = “” + Math.round(linear (t, 0, dur, beginCount, endCount));

    Dan

  • Henry Gretzinger

    February 28, 2008 at 10:08 pm

    Thanks, Dan!

    Works a charm…

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