Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Timer expression shifting position with count

  • Timer expression shifting position with count

    Posted by Dustin Parsons on December 19, 2016 at 6:33 pm

    I made a 2 min countdown timer but I’m having trouble with it’s position moving as the numbers change. Is there any way to lock down the position so it doesn’t move horizontally with every number change?

    Can’t figure out how to embed an animated gif so here it is:
    https://giphy.com/gifs/l0HlIuzWDj86PYN0I

    And here’s the expression I’m using:
    countspeed = -1;
    clockStart = 120;

    function times(n){
    if (n < 10) return "0" + n else return "" + n
    }

    clockTime = clockStart +countspeed*(time - inPoint);

    if (clockTime < 0){
    minus = "-";
    clockTime = -clockTime;
    }else{
    minus = "";
    }

    t = Math.floor(clockTime);
    h = Math.floor(t/3600);
    min = Math.floor((t%3600)/60);
    sec = Math.floor(t%60);
    ms = clockTime.toFixed(3).substr(-3);
    minus + times(min) + ":" + times(sec)

    Dustin Parsons replied 9 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Walter Soyka

    December 19, 2016 at 7:02 pm

    Would it help if you set the text layer to left-justified instead of centered?

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Dustin Parsons

    December 19, 2016 at 7:24 pm

    That would help! Haha, can’t believe I hadn’t tried that. Thanks Walter

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