Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: ForumAE BasicsAE ExpressionsTutorialsArticlesPodcastsMotion GraphicsTrainingCinema 4D

creating a countdown

Cow Forums : Adobe After Effects
creating a countdown
by Michael Cline on Apr 7, 2008 at 3:53:20 pm

Hello,
i need to create a ten minute countdown, does anyone know of a tutorial that would help me accomplish this?
cheers
-michael

Respond to this post   •   Return to posts index

Re: creating a countdown
by Dave LaRonde on Apr 7, 2008 at 4:08:49 pm

Use the Time effect. I think it's now hidden in the text effects. Set it for Timecode, then animate it backwards. Cut some masks on a solid, then use it as a track matte to get rid of the parts you don't need.

Don't forget that an NTSC comp needs to be 29.97 fps and not 30 fps.

Dave LaRonde
Sr. Promotion Producer
KCRG-TV

Respond to this post   •   Return to posts index

Re: creating a countdown
by Darby Edelen on Apr 7, 2008 at 5:41:46 pm

You can try adding an expression to the Source Text property of a text layer:


offset = 0;
i = inPoint + offset; //the in point of the layer
dur = 10; //the duration of the countdown in minutes
dur *= 60; //the duration of the countdown in seconds

seconds = Math.max(dur - Math.max((time - i), 0),0); //the countdown time in total seconds
minutes = Math.floor(seconds / 60); //the countdown time in minutes
seconds = Math.floor(seconds - (minutes * 60)); //the countdown time in seconds (minus minutes)

if(seconds < 10) seconds = '0' + seconds; //add an additional '0' in front of single digit seconds

minutes + ':' + seconds


You can then use any font you like with formatting. The only downside is that you can't use character specific formatting, the formatting must be uniform for all of the text.

The countdown will begin at the beginning of the layer and continue for ten minutes (in this case). You can increase the 'offset' value above to allow the text to appear before the countdown begins. A value of 10 would show the countdown for 10 seconds before it actually began to countdown.


Darby Edelen
Designer
Left Coast Digital
Santa Cruz, CA

Respond to this post   •   Return to posts index


Re: creating a countdown
by Michael Cline on Apr 7, 2008 at 6:05:38 pm

very cool, i'll try both of these......
thanks!

Respond to this post   •   Return to posts index

Re: creating a countdown
by david bogie on Apr 8, 2008 at 3:00:01 pm

Darby, man, you're scary. Mean that in the best way possible.
I think in pictures. I am in awe of folks who think in code or who can even conceive of the steps necessary to create the code.

bogiesan

This is my standard sigfile so do not take it personally: "For crying out loud, read the freakin' manual."

Respond to this post   •   Return to posts index

Re: creating a countdown
by Darby Edelen on Apr 8, 2008 at 11:10:04 pm

You should meet a real programmer, WOW. I did take 2 years of programming in high school and a year at the college level. The biggest help is learning how to think about programming conceptually (even 'visually' with flow charts). The way most programmers start is by writing pseudocode that is basically plain english and describes what needs to be accomplished:


offset = 0;
i = inPoint + offset; //the in point of the layer
dur = 10; //the duration of the countdown in minutes
dur *= 60; //the duration of the countdown in seconds

seconds = Math.max(dur - Math.max((time - i), 0),0); //the countdown time in total seconds
minutes = Math.floor(seconds / 60); //the countdown time in minutes
seconds = Math.floor(seconds - (minutes * 60)); //the countdown time in seconds (minus minutes)

if(seconds < 10) seconds = '0' + seconds; //add an additional '0' in front of single digit seconds

minutes + ':' + seconds


Might be written (or thought of) as:

-Find out where our layer starts and use this as the start for the countdown.
-Find out how many minutes we need for the countdown.
-How many seconds is that?
-Countdown from that number of seconds to 0.
-Translate the countdown in seconds to "minutes:seconds"

Then it's just a matter of understanding how you can easily accomplish each one of these steps and stitching them together.

I didn't write the above code with any functions, but often it helps to find a step that will be repeated often (perhaps such as converting a number of seconds to "minutes:seconds" ) and writing a function that does just that:


function secondsToTime(s){

minutes = Math.floor(s / 60); //the countdown time in minutes
seconds = Math.floor(s - (minutes * 60)); //the countdown time in seconds (minus minutes)

if(seconds < 10) seconds = '0' + seconds; //add an additional '0' in front of single digit seconds

return minutes + ':' + seconds;
}


The call secondsToTime(60); would then return "1:00" and the final code would look like:


function secondsToTime(s){

minutes = Math.floor(s / 60); //the countdown time in minutes
seconds = Math.floor(s - (minutes * 60)); //the countdown time in seconds (minus minutes)

if(seconds < 10) seconds = '0' + seconds; //add an additional '0' in front of single digit seconds

return minutes + ':' + seconds;
}

offset = 0;
i = inPoint + offset; //the in point of the layer
dur = 10; //the duration of the countdown in minutes
dur *= 60; //the duration of the countdown in seconds

seconds = Math.max(dur - Math.max((time - i), 0),0); //the countdown time in total seconds

secondsToTime(seconds); //calling our custom function which returns a string




Darby Edelen
Lead Designer
Left Coast Digital
Santa Cruz, CA

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINEDVDsBOOKSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]