User Guide

317
ADOBE AFTER EFFECTS 5.0
User Guide
ā€¢ Type /* at the beginning of the comment and */ at the end of the comment. Any text
between /* and */ is ignored. For example:
/* This is a
multiline
comment */
Understanding the expression language
The After Effects expression language is based on JavaScript 1.2, with an extended set of
built-in objects. All expressions start with a global object. Only an attribute or method of
the global object can appear in an expression with nothing to the left of it.
The global object for any expression is the layer on which the expression is written. For
example, if you add an expression to the Scale property of a layer named Solid1 and you
want the expression to return Solid1ā€™s Position property values, you can use any of the
following expressions, as they are equivalent:
this_comp.layer("Solid1").position
this_layer.position
position
To retrieve values from an object other than the layer containing the expression, insert the
object in the expression. For example, if you write an expression on a layer named Solid1
and you want to retrieve position values from a layer named Solid2, use the following
expression:
this_comp.layer("Solid2").position
Accessing elements in an expression
Use the expression language to access properties in After Effects that have a numeric value.
To access a value, use a chain of object references, separated by the period (.) operator. To
understand the order in which you can add elements to an expression, use the ā€œAfter
Effects expression language guideā€ on page 324 to learn what the element returns.
Consider the following procedure as an example of how to construct an expression using
the After Effects expression language guide:
UG.book Page 317 Wednesday, February 21, 2001 12:05 PM