Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expressions question: creating control that displays a variable’s value

  • Expressions question: creating control that displays a variable’s value

    Posted by Nicholas White on May 6, 2005 at 8:19 am

    Hello,

    For testing purposes I want to see what the value of a variable is that I’ve created in an expression.

    For the position of layer 1 I’ve added the following expression:

    x = random(0,1)*100;

    position = [300+x, 200+x]

    What I’m trying to do is add a slider box controller to the position property which will show me what the value of x is at any time in the timeline. It’s easy to find the position value, but when I try to add something like:

    thisLayer.position.x

    I get “Undefined value used in expression. Could be an out of range array subscript?”

    I’m able to do this when writing scripts by using the alert() method to pop up little boxes with the value of x in it…can I do something similar with expressions?

    Thanks

    Nick

    Dan Ebberts replied 21 years ago 3 Members · 2 Replies
  • 2 Replies
  • Mylenium

    May 6, 2005 at 9:37 am

    Nope, not really. Actually you would need to work differently and generate your random values or whatever separately on another layer. Those can then be linked to text layers, sliders etc. for visual feedback. Having an alert() in expressions would be kinda counter-productive, don’t you think?

    Mylenium

    [Pour Myl

  • Dan Ebberts

    May 6, 2005 at 1:14 pm

    If you wanted to show the x position value with a slider applied to the same layer, you could use:

    position[0]

    If you wanted to display it with a text layer you’d use this expression for the source text:

    thisComp.layer(“your layer”).position[0]

    Dan

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