Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Fake Youtube Counter

  • David Conklin

    December 8, 2014 at 10:49 pm

    You can use the below expression on the source text property of a text layer. There are four variables you can change to suit your purposes. The values I’m gving you count from 301 to 215,000,000 over 60 seconds. Remember that even in a whole minute there are not 215 billion frames, so your steps per frame will be quite large.

    The function ‘formatTime’ is what adds the commas. It is taken from this site: https://blog.tompawlak.org/number-currency-formatting-javascript – You should check it out for more info on how it works.

    function formatNumber (num) {
    return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")
    }
    var beginTime = 0; //time to start counting (seconds)
    var finishTime = 60; //time to finish countint (secs)
    var beginVal = 301; //first number;
    var finishVal = 215000000; //end number
    formatNumber(ease(time, beginTime, finishTime, beginVal, finishVal));

    David Conklin
    Motion Designer

  • Odille Grouillard

    December 9, 2014 at 12:43 am

    Thanks David, this works great.
    Just a quick follow up question:

    The counter starts and 301 and ends at 215,000,000 but the frames in between, it jumps around to random number – 46,005,156 to 51,245,589,358 to 557,971,159,789 etc… – and not progressing in numerical order. Is there anyway around that?

    Thanks,
    OG

  • David Conklin

    December 9, 2014 at 2:59 pm

    Heya. Try this guy. The decimals during the incrimination were causing some problems, this just rounds the numbers. Sorry about that.

    function formatNumber (num) {
    return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")
    }
    var beginTime = 0; //time to start counting (seconds)
    var finishTime = 60; //time to finish countint (secs)
    var beginVal = 301; //first number;
    var finishVal = 215000000; //end number
    var anim = ease(time, beginTime, finishTime, beginVal, finishVal)
    formatNumber(Math.round(anim));

    David Conklin
    Motion Designer

  • Odille Grouillard

    December 9, 2014 at 6:49 pm

    No need to apologise, David. You really helped me out.
    Thanks again, this is great.

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