Amended AE Expression – to work between two markers

July 20th, 2011

Countdown text initially reads 100 but once playhead reaches first marker (“1″) count down begins counting back from 100 to 0
Countdown text will reach 0 when the playhead reaches the second marker (“2″) and will stay at 0 thereafter

or to put it in a more simplistic way – it does exactly what the client wants.

var tTF = timeToFrames();
var frDuration = thisComp.frameDuration;
var endTime = thisComp.marker.key("2").time;
var stTime = thisComp.marker.key("1").time;
var currentTime = tTF*frDuration;
var totalTime = endTime - stTime;

var content = 100-(((currentTime-stTime)/totalTime)*100);

if (currentTime > stTime)
{

if (content > 0)
content
else
0
}
else
100

little note for later gotchas – can’t use the variable name ‘startTime’ as it appears to be reserved – it kept giving me the number 6 though i am not sure why

One Response to “Amended AE Expression – to work between two markers”

  1. You didn’t agree like a fool – you agreed like an angel. You are so going on the website. I’ll marshall my powers over the written word to compose something suitable dripping with praise. xxx

Leave a Reply