ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Count from 0 to a billion

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
JefftheiRide
Count from 0 to a billion
on Oct 20, 2006 at 2:39:08 pm

I need to create a counter that goes higher than 30 000. I need to go from 0 to a billion and i cant figure out the expressions controls. thanks



Return to posts index

Dave LaRonde
Re: Count from 0 to a billion
on Oct 20, 2006 at 2:59:52 pm

Do an advanced search -- not a regular search -- on the posts in this forum using terms like "countdown", "counter", "experession", "timer", etc. Go back at least 6 months.

You will be rewarded by discovering the technique to do this, because the topic has been covered many times.

Dave LaRonde
Sr. Promotion Producer
KCRG-TV


Return to posts index

JefftheiRide
Re: Count from 0 to a billion
on Oct 20, 2006 at 3:34:03 pm

I looked. cant find anything. it limits how high i can gol. i want to go past 30 000. Im at aloss



Return to posts index


JefftheiRide
Re: Count from 0 to a billion
on Oct 20, 2006 at 3:54:18 pm

so i didnt find anything . i just need to go from 0 to a billion. not 60 or whatever. i dunno how to by pass it. driving me nuts!



Return to posts index

sam.mltn
Re: Count from 0 to a billion
on Oct 20, 2006 at 4:43:18 pm

copy and paste the expression below to a source text layer with an expression slider added.

Found this on the web. can't remember who I got it from.

s = effect("value")("Slider");
m = effect("multiplier")("Slider"); //use for numbers greater than 1 million
v = s*m; //value of counter

function digits(Val, Digits)
{var n = Val.toString();


Return to posts index

sam.mltn
Re: Count from 0 to a billion
on Oct 20, 2006 at 4:46:51 pm

I left off some instructions.

there are two sliders
one renamed value
one renamed multiplier

Animate the value slider and or the multiplier. If you want 3 commas you'll have to add some more code.


Return to posts index


JefftheiRide
Re: Count from 0 to a billion
on Oct 20, 2006 at 4:50:57 pm

ok man thanks...but when i drop it in it gives me an error saying unknown value?



Return to posts index

sam.mltn
Re: Count from 0 to a billion
on Oct 20, 2006 at 5:46:44 pm

did you add the expression sliders?


Return to posts index

Colin Braley
Re: Count from 0 to a billion
on Oct 20, 2006 at 7:48:36 pm

Create a new text layer. Add the following expression to source text. Adjust the variables to do whatever you need.

//begin code

startTime = 0; //seconds
endTime = 5; //seconds
beginCount = 0;
endCount = 2000;
hasCommas = true;
//--dont modify below here----------------
function addCommas ( s ){
if( s.length <= 3 )
return s;
else
return s.substring(0 , 3) + "," + addCommas(s.substring(3, s.length));

}
function reverse( s ){
newStr = "";
for(i = s.length-1; i >= 0; i--)
newStr += s.charAt(i)
return newStr;
}

val = Math.round (linear(time, startTime, endTime, beginCount, endCount) );
if( hasCommas )
reverse (addCommas(reverse( val + "" )))
else
val


//end code

~Colin


Return to posts index


Colin Braley
Re: Count from 0 to a billion
on Oct 20, 2006 at 7:50:08 pm

...Allthough if i was doing this myself for a project I would use sliders as mentioned above....allthough if you don't know what sliders are it would prbably be faster to just paste in the expression i wrote.


Return to posts index

Abdelrhman Ali
Re: Count from 0 to a billion
on Nov 29, 2017 at 9:52:27 am

Thank you dearly this was extremely helpful.


Return to posts index

Liran Tabib
Re: Count from 0 to a billion
on Apr 22, 2016 at 7:18:02 am

the main thing is to use a point control instead of a slider control because it's not limited to 1,000,000. the Counter preset does the same:
http://www.vdodna.com/products/counter-preset/


Return to posts index

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