Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Adjustable countdown for Essential Graphics

  • Adjustable countdown for Essential Graphics

  • Gerben Greuliker

    September 26, 2022 at 9:21 am

    Hi There,

    I’m working on a project where I have to make a money counter (with two decimals) that has a variable start and end value. So let’s say the start value has to be € 2456,95 and the end value has to count down to € 1354,15. The whole thing also has to work in an Essential Graphic so the editor can adjust these values in Premiere.

    I tried to build it but my knowledge of scripting is as shallow as a quick drying pool on a hot summers day. Can someone throw me a bucket of water?
    🙂

    Thnx in advance,

    Gerben

  • Filip Vandueren

    September 27, 2022 at 2:35 pm

    Hi Gerben,

    try this:

    1. startValue = effect("from")("Slider").value;
    2. endValue = effect("to")("Slider").value;
    3. startSecond = 1;
    4. endSecond = 4;
    5. v = ease(time, startSecond, endSecond, startValue, endValue);
    6. new Intl.NumberFormat('nl-NL', {
    7. style: 'currency',
    8. currency: 'EUR',
    9. useGrouping: false
    10. }).format(v);
  • Gerben Greuliker

    September 30, 2022 at 8:15 am

    Thnx Filip!

    It works great!
    The only problem is that I get an error on the last bit of the script.
    Line 6: ‘new Intl.NumberFormat’. The ‘Intl’ is not recognized as a property or method.
    So the rest of the expression doesn’t work.

    Is there a simple fix?
    thnx in advance

    Gr Gerben

  • Filip Vandueren

    September 30, 2022 at 10:23 am

    Can you go to your project settings and check that the expressions language is on “JavaScript”, it’s probably on Legacy Extendscript mode?

  • Gerben Greuliker

    October 3, 2022 at 7:28 am

    If you mean the ‘Enable JavaScript Debugger’ checkbox under the ‘Scripting & Expressions’ tab, that one is checked…

  • Filip Vandueren

    October 3, 2022 at 8:58 am

    That’s in preferences, I mean in project settings (where you also set color space)

  • Gerben Greuliker

    October 7, 2022 at 9:20 am

    Haha missed that one 🙂
    Thnx for your time and feedback.

    Sorry to say but now I get another mishap.
    ‘Error at line 1: Couldn’t return result into numeric value’

    I’m using the Numbers effect to generate the value to get my correct format (comma and the two decimals). Has this anything to do with the error?

  • Filip Vandueren

    October 7, 2022 at 1:13 pm

    Hi Gerben, my expression is for a text-layer’s sourceTect property, so it returns a correctly formatted string, not a number.

    If you need just the number (to use on a slider) delete everything starting at New Intl…

  • Gerben Greuliker

    October 14, 2022 at 8:07 am

    I was not able to check it earlier but it works like a charm!
    Thnx for the patience and input.

    Gr G

  • Filip Vandueren

    October 14, 2022 at 8:30 am

    Graag gedaan Gerben 🙂

Viewing 1 - 10 of 10 posts

Log in to reply.

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