Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expression for Digital 24 Hours clock

  • Expression for Digital 24 Hours clock

    Posted by Gilben on October 14, 2005 at 1:02 pm

    I am looking for a smarter way to build a count down 24 hours clock.
    I couldnt find the right plugin for this (the text number effect – is not good for 24 hours count down and has no 100/th of a sec.)
    Doing this with key frames seem to me no too effecient.

    I was thinking maybe anyone of you is familiar with plug in or if it could be done with animation Expression.

    Tnx for any help
    Gil

    Matthewb replied 20 years, 2 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    October 14, 2005 at 5:30 pm

    24 hour count down clock (expression for text layer source text):

    // 24 hour count down clock

    beginHr = 23;
    beginMin = 59;
    beginSec = 59;
    beginHun = 0;

    beginTime = (beginHr*60 + beginMin)*60 + beginMin + beginHun/100;

    function digits(myVal,myNumDigits){
    var s = myVal.toString();
    while (s.length < myNumDigits) s = '0' + s; return s; } currTime = beginTime - time; hr = digits(Math.floor(currTime/3600),2); min = digits(Math.floor((currTime%3600)/60),2); sec = digits(Math.floor(currTime)%60,2); hun = digits(Math.floor(currTime%1*100),2); hr + ":" + min + ":" + sec + "." + hun Dan

  • Dan Ebberts

    October 14, 2005 at 6:22 pm

    You’d think I’d have learned by now to always try it before posting. This should work better:

    beginHr = 3;
    beginMin = 0;
    beginSec = 1;
    beginHun = 0;

    beginTime = (beginHr*60 + beginMin)*60 + beginSec + beginHun/100;

    function digits(myVal,myNumDigits){
    var s = myVal.toString();
    while (s.length < myNumDigits) s = '0' + s; return s; } currTime = beginTime - time; hr = digits(Math.floor(currTime/3600),2); min = digits(Math.floor((currTime%3600)/60),2); sec = digits(Math.floor(currTime)%60,2); hun = digits(Math.floor(currTime%1*100),2); hr + ":" + min + ":" + sec + "." + hun Dan

  • Gilben

    October 15, 2005 at 8:02 am

    Dan

    Thank you very vewry much for your serious respond.
    i will try it your way

    i quess i should take some tutorials in expression methods.

    thanx alot.
    Gil

  • Matthewb

    March 13, 2006 at 4:18 am

    Dan/Anyone

    what is taking place here in your expression:
    function digits(myVal,myNumDigits){
    var s = myVal.toString();
    while (s.length < myNumDigits) s = '0' + s; return s; } i can follow the rest but am having trouble with what "function" is performing (adobe help, wasnt) then waht is the digits command accomplishing... s i take it is getting the length of myVal i think i can figure it from there... just am not sure what is happening at the beginning... i have to write a clock that starts at a specific point and stops at a specific point over a specified period... i.e. clock starts at 30.0 seconds and over 2 second climb to 43.14 seconds. thanks,

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