Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Counter + Blinky expression

  • Counter + Blinky expression

    Posted by Navarro Parker on August 25, 2013 at 9:40 pm

    I have Dan’s standard counting expression.

    Would it be possible to affect opacity once it reaches a certain number?

    Here’s the non-code version: Count from 000 to 250 over 2 seconds starting at the layer in-point. Once the value equals 250, blink the opacity off and on three times (3 cycles of 2 frames on, 2 frames off) and then remain at 100% opacity

    Navarro Parker replied 13 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 26, 2013 at 9:14 pm

    I don’t think this is optimum, but something like this modified source text expression might work:


    numDecimals = 2;
    commas = true;
    dollarSign = true;
    beginCount = -1999;
    endCount = 1999;
    dur = 4;

    t = time - inPoint;
    s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);
    f = timeToFrames(t-dur);
    if ((t > dur) && (f < 12) && (f%4 < 2)){
    "";
    }else{
    prefix = "";
    if (s[0] == "-"){
    prefix = "-";
    s = s.substr(1);
    }
    if(dollarSign) prefix += "$";

    if (commas){
    decimals = "";
    if (numDecimals > 0){
    decimals = s.substr(-(numDecimals + 1));
    s = s.substr(0,s.length - (numDecimals + 1));
    }
    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);
    }
    prefix + outStr + decimals;
    }else{
    prefix + s;
    }
    }

    If it really needs to be opacity, you’ll need to synchronize the two expression.

    Dan

  • Navarro Parker

    September 4, 2013 at 8:49 pm

    That works great! Thank you!

    How would you keep leading/trailing zeros? (need 5 is displayed as 005.0)

    And what line controls the duration of blinks/number of blinks?

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