Groups > Multimedia > Adobe After Effects expressions > Re: scrolling numbers, the final hurdle




scrolling numbers, the final hurdle

scrolling numbers, the final hurdle
Tue, 22 Jan 2008 14:33:52 -080
ok, so one LAST, question. I've got this expressions moving perfectly (here is
the expression):

numDecimals = 2;
commas = true;
dollarSign = true;
beginCount = -1999;
endCount = 1999;
dur = 4;

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;
}
, except that it jumps from 0 to 600,00 in one frame. I need this numbers to
count up more gradually. When I go over Dan's notes, it seems the place to make
that adjustment is in the substr(). Being new to expressions, when I look over
this equation, there are many instances of substr(). I've fiddled with them for
a while but can't seem to find the right combination. Any expression gurus out
there?

Thanks!

Post Reply
Re: scrolling numbers, the final hurdle
Tue, 22 Jan 2008 21:09:01 -080
Hmmm... are you sure that's the exact expression you're using? I don't see how
it could possibly get to 600,000 with the parameters defined the way you have
them shown.

Post Reply
about | contact