User Guide

CHAPTER 10
310
Creating Expressions
To learn about the more powerful aspects of JavaScript, consult a JavaScript reference
manual, such as JavaScript: The Definitive Guide, by David Flanagan.
Note: After Effects uses only the core standard JavaScript language, not the Web browser-
specific extensions. Instead of Web browser extensions, After Effects contains its own set of
extension objects such as Layer, Comp, Footage, and Camera that you can use to access most
of the values in an After Effects project.
Creating expressions
All of your work adding, editing, and writing expressions occurs in the Timeline window.
When you add an expression to a layer property, a default expression appears in a text field
under the property. Use this field to type new expressions or edit expression variables.
Some expressions rely on the names of layers in your project; if you change the name of a
layer that is involved in an expression, the expression will not work.
To create an expression:
1 Select a property in the Timeline window and do one of the following:
Choose Animation > Add Expression.
Alt-click (Windows) or Option-click (Mac OS) the property’s stopwatch icon.
Note: After Effects automatically fills the expression field with a default expression that copies
the fixed value of the property, or the value of the keyframes, if any.
2 Create the expression by doing one of the following:
Drag the pick whip ( ) to another property in the Timeline or Effect Controls window.
If you want, modify the pick whip results. See “Creating expressions with the pick whip
on page 312.
Type an expression directly over the existing text. See “Writing your own expressions
on page 315. If you want, use the language elements menu to enter properties, functions,
and constants. See “Using the expression language menu on page 321.
3 Click outside of the expression field or press Enter on the numeric keypad to activate
the expression.
Note: If an expression cannot be processed, After Effects displays a message explaining the
error and automatically disables the expression. A yellow warning icon ( ) appears next to
the expression; click the warning icon to view the error message again.
UG.book Page 310 Wednesday, February 21, 2001 12:05 PM