Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Control Scale with a Null

  • Control Scale with a Null

    Posted by Simon Terrey on March 1, 2023 at 3:37 pm

    Hi there! I used to use this expression to control an objects scale with a Null but it no longer works in CC2023:

    AE says: Line 7 (dis = length…) is at fault. Has the expression language changed?

    mouse_layer = thisComp.layer(“Scale_Control”);//Mouse layer

    beginScale = [100,100]; //

    endScale = [50,50]; //

    beginDistance = 200;//Distance to begin magnifying in pixels

    endDistance = 0;//Distance to end magnifying in pixels

    //–Don’t modify below here

    dis = length(this.position, mouse_layer.position);

    ease(dis, beginDistance, endDistance, endScale, beginScale);

    Simon Terrey replied 3 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 1, 2023 at 4:46 pm

    Try changing this line:

    dis = length(this.position, mouse_layer.position);

    to this:

    dis = length(position, mouse_layer.position);
  • Simon Terrey

    March 1, 2023 at 5:08 pm

    Amazing! When I turned ‘Legacy ExtendScript’ on in Expressions in Project Settings the old script worked but yours works fine in JavaScript.

    Thank you so much Dan!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy