FORUMS: list search recent posts

Ramping the numbers expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Will Eccleston
Ramping the numbers expression
on Aug 27, 2012 at 7:15:48 pm

Is there a way to very smoothly ramp into a number counter expression? Start counting slowly and ramp up over time? I'm using an expression that I think is Dan's originally, (not sure). Any help very much appreciated and sorry if this has been covered, I swear I searched. I want to take a couple or three seconds to get into the mid-hundred-thousands and then increase the pace so that by 5 or 6 seconds I'm in the trillions. Here's what I'm using, no ramp:

numDecimals = 0;
commas = true;
dollarSign = true;
beginCount = 00;
endCount = 222222187652003;
dur = 35;
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;
}

Will Eccleston
Kinetiscape Films


Return to posts index

Dan Ebberts
Re: Ramping the numbers expression
on Aug 27, 2012 at 8:44:37 pm

Try replacing the line that defines variable s with this:

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


Dan



Return to posts index

Will Eccleston
Re: Ramping the numbers expression
on Aug 28, 2012 at 3:05:19 pm

Seems to have worked. Thank you! I wish I could download your understanding of this stuff. I can learn programming languages, and have before, but just being able to comprehend the operations that need to take place to achieve the goal, that's something else entirely.

Will Eccleston
Kinetiscape Films


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]