User Guide

321
ADOBE AFTER EFFECTS 5.0
User Guide
Accessing specific values in a vector or array
You can create an expression that references just one value within the array of a 2D or 3D
property. By default, the first value is used, unless you specify otherwise. For example, if
you drag the pick whip from layer 1’s Rotation property to layer 2’s Scale property, the
following expression appears:
this_comp.layer(2).scale[0]
By default, the above expression uses the first value of the Scale property, which is width.
If you prefer to use the height value instead, drag the pick whip directly to the second value
instead of the property name, or change the expression as follows:
this_comp.layer(2).scale[1]
Conversely, if you drag the pick whip from layer 2’s Scale property to layer 1’s Rotation
property, After Effects automatically duplicates the expression so that two values are
available for the scale. The following expression appears:
[this_comp.layer(1).rotation, this_comp.layer(1).rotation]
To use a different value as one of the value parameters instead of doubling the one rotation
value, remove the duplicate expression and insert a value. For example, to use the rotation
value for the scales height and 10 for the width, use the following expression:
[this_comp.layer(1).rotation, 10]
Using the expression language menu
The expression language menu contains all the After Effects–specific language elements
that you can use in an expression. This menu is helpful for determining valid elements and
their correct syntax; use it as a reference for available elements.
Select any object, attribute, or method, and After Effects automatically inserts it in the
expression field at the location of the cursor. Then, edit and add to it as needed. For
example, if you want to begin an expression with the comp as the object, select
“this_comp from the Global menu:
this_comp
UG.book Page 321 Wednesday, February 21, 2001 12:05 PM