# AE ENHANCERS

Expressions/Scripts/Presets
 It is currently Thu Jun 20, 2013 5:24 am

 All times are UTC - 8 hours [ DST ]

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Countdown expression helpPosted: Wed Nov 05, 2008 1:33 pm

Joined: Sun Feb 17, 2008 10:59 pm
Posts: 2
I'm using Dan Ebbert's script:

Code:
rate = -2;
clockStart = 3604.999;

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

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

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

t = Math.floor(clockTime);
hr = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);

What I'd like to do is add days and make the hours cycle at 24. My desired output is:
18 : 23 : 59 : 59
(days hours minutes seconds)

I can't figure this out at all. Any help or pointers will be appreciated.

Top

 Post subject: Re: Countdown expression helpPosted: Wed Nov 05, 2008 7:55 pm

Joined: Sat Jun 26, 2004 10:01 am
Posts: 299
Location: Folsom, CA
Play around with this:

Code:
rate = -2;
clockStart = 86404.999;

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

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

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

t = Math.floor(clockTime);
day = Math.floor(t/(86400))
hr = Math.floor((t%86400)/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);

Dan

_________________
http://www.motionscript.com

Top

 Post subject: Re: Countdown expression helpPosted: Thu Nov 06, 2008 11:13 am

Joined: Sun Feb 17, 2008 10:59 pm
Posts: 2
Thanks Dan, this worked great. I linked the rate to a slider and was able to control the speed just as I liked too.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC - 8 hours [ DST ]

#### Who is online

Users browsing this forum: No registered users and 0 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Announcements    Announcements Expressions    Expressions Library    Expressions Tutorials    Expression Discussion Scripts    General Scripts Library    Script Tutorials    Scripts Discussion    Script requests User Scripts    Paul Tuersley's Scripts    Impudent 1's Scripts Animation Presets    Animation presets Library