FORUMS: list search recent posts

# counter duration between two markers

FAQ   •   VIEW ALL
 counter duration between two markers on Feb 18, 2015 at 7:50:46 am

pls!!! I need help... i need to modify this expression "duration" ("dur") to duration between two markers duration.. sorry for my English...

That mean I need to count this counter from first marker to next marker....

(I need to modify 6th row "dur" for that)
can anyone give me suggestions...
pls help... Thank you...

```numDecimals = 0; commas = true; dollarSign = false; beginCount = comp("Credits").layer("Lower Third Controller").effect("Begin Count Number")(1); endCount = comp("Credits").layer("Lower Third Controller").effect("End Count Number")(1); dur = comp("Credits").layer("Lower Third Controller").effect("Counter Duration")(1); t = time - inPoint; s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals); prefix = ""; if (s[0] == "-"){ prefix = "-"; s = s.substr(1); } if(dollarSign) prefix += "\$"; if (commas){ decimals = ""; if (numDecimals > 0){ decimals = s.substr(-(numDecimals + 1)); s = s.substr(0,s.length - (numDecimals + 1)); } outStr = s.substr(-s.length, (s.length-1)%3 +1); for (i = Math.floor((s.length-1)/3); i > 0; i--){ outStr += "," + s.substr(-i*3,3); } prefix + outStr + decimals; }else{ prefix + s; }```

 Re: counter duration between two markerson Feb 18, 2015 at 5:35:43 pm

If I understand what you're trying to do, I think you can just change this line:

s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);

to this:

s = linear (time, marker.key(1).time, marker.key(2).time, beginCount, endCount).toFixed(numDecimals);

You should then also be able to delete the lines that define "dur" and "t".

Dan