decorative banner

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

Related Subtopics: