Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions error with valueAtTime

  • error with valueAtTime

    Posted by Jamie Bradshaw on March 4, 2008 at 2:54 pm

    Am I going mad? Is there something wrong with this expression?

    x3 = thisComp.layer(“Null 1”).transform.position[0].valueAtTime(0);

    I keep getting an error saying that the function is undefined.

    Any help would be massively appreciated.

    Thanks,
    Jamie

    Darby Edelen replied 18 years, 5 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    March 4, 2008 at 2:57 pm

    You need to put the array indexing at the end, like this:

    x3 = thisComp.layer(“Null 1”).transform.position.valueAtTime(0)[0];

    Dan

  • Jamie Bradshaw

    March 4, 2008 at 2:59 pm

    ah I see thanks a million Dan. 🙂

    Still a bit confused as to why it has that syntax. My way seems to make more sense, but who am I to argue! 🙂

  • Darby Edelen

    March 5, 2008 at 10:25 pm

    [Jamie Bradshaw] “Still a bit confused as to why it has that syntax”

    x3 = thisComp.layer("Null 1").transform.position[0].valueAtTime(0);

    In the above statement, thisComp.layer("Null 1").transform.position[0] evaluates to a float value which has no associated function valueAtTime().

    x3 = thisComp.layer("Null 1").transform.position.valueAtTime(0)[0];

    In the above statement thisComp.layer("Null 1").transform.position.valueAtTime(0) evaluates to the position property at a given time. A property has access to the valueAtTime() function because it is a method of the property class, where as a float value has no associated methods/functions.

    Darby Edelen
    Designer
    Left Coast Digital
    Santa Cruz, CA

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