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

After Effects - Millions to Thousands

description of image

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

Share with third party communities This will take you to a new window.


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)

What do you think?

Collapse

More from irock195

  1. Lights and Sounds and Particular 2

    Lights and Sounds and Pa...

    10/09/09 1500 views
  2. Multi-touch Mice? What do you think. [ Discussion ]

    Multi-touch Mice? What d...

    10/06/09 2595 views
  3. KKlass A14 | Lampard

    KKlass A14 | Lampard

    09/03/09 2254 views
  4. Fire Girl! Flame on!

    Fire Girl! Flame on!

    08/25/09 2522 views
  5. Kontain Theme: Love and Hugs

    Kontain Theme: Love and ...

    06/18/09 2098 views
  6. Minitutorial : Rotate Arbitrary in Photoshop

    Minitutorial : Rotate Ar...

    06/16/09 2323 views

Subscribe to irock195

Feeds are an easy way to stay up-to-date with websites you love. Feeds automatically update and show you the newest content without you having to check. Read more here.

All you need is a Feed Reader, like these free ones for Mac and PC.

Close
Collapse

Featured Kontainers

Copyright © 2010 Kontain LLC. All rights reserved