See snapshots of what Ian is doing in real-time.

Join now and start following @irock195.

Get the Kontain app and take your own snapshots!

View all of irock195's updates Kontained: 18 months ago

After Effects - Millions to Thousands

Displaying: 1 of 1

I had to create a presentation earlier this week and needed it to look pretty slick. I put together the presentation in Keynote but it was comprised of a series of videos done with After Effects. One of the things I had to do was animate a bar graph moving down. Pretty simple, but I also needed to show the number decrementing as well. Not too hard, but then I needed to show the number decrease from Millions to Thousands. It couldn't say 1,000,000 it had to say '1m'. Now it's getting fun!! The movie shows what it looked like. Below is how I did it.


Step 1: Create Text Layer.

Step 2: Add a Slider Control. Effect > Expression Control > Slider Control

Step 3: Create a new Expression on the Text Layer's "Source Text" Property.

Step 4: Animate Slider.

Step 5: High Five Somebody.


// Add Slider

mySlider=thisLayer.effect("Slider Control")("Slider");

// Set a number range for Slider (SliderInstance, Start, End, Range1, Range2)

// For Millions > Hundred Thousands keep it in the 100's to thousands

myNumber=linear(mySlider,0,100,1600,850);

// Round the number

num = Math.round(myNumber);

// Set the default type to 'k'

type = "k"

// Check to see if it's above 999 and make it equal millions

if(num > 999)

{

type = "m"; // denote as millions

num = num/1000; // divide by 1000 to get a number like 1.5484372384

}

str = "" + num ; // put the number into a string

// the magic - set the text value to equal "$1.53m" or "884k"

// str.slice(0,4) returns the part of str between the first index (first character)

// and the fourth index (fourth charcter) - so for a number like 1.54854234 it'll return

// 1.54 cause it counts the decimal! for a number like 984 it'll just return 984.

["$" + str.slice(0,4)+ type]

// End Expression

Share this entry

Close
Invalid e-mail format, please try again

Your friends will be notified via email about this entry.

Remove Email

You are about to remove the selected emails from your list. Are you sure you want to remove them?

Yes
Cancel
Select All Deselect All Remove Selected

Report Inappropriate Content

Close
Details
Operations

Thank You!

The safety and legitimacy of Kontain's content is paramount to us. We will be investigating this content shortly. Here is what you reported:

Report Category Harmful of Dangerous Acts Report Detail Drug Abuse
Additional Information

Lorem ipsum dolor sit amet consectetuer adipiscing elit penubrum purous

Comments (2)

To add comments please login OR signup and activate your account by clicking the activation link in the signup confirmation email.

irock195

28 Updates

Designer
  • First Name:
  • Last Name:
  • Location:
  • City:
Twitter:
Website:
Bio:
Loading…
  1. Fi

    Fi


    230 Updates Updated: 1 hour ago
  2. SNDKno

    Rune Wold


    286 Updates Updated: 2 days ago
  3. daddymccoy21

    Aaron McCoy


    33 Updates Updated: 13 days ago
  4. kchrst

    Niels Kristian Ch...


    21 Updates Updated: 18 days ago
  5. Snowleopard

    Trygve


    101 Updates Updated: 21 days ago

Previous / Next Updates

More From Ian

Copyright © 2010 Kontain LLC. All rights reserved