Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions substr is not a function error

  • substr is not a function error

    Posted by David Cabestany on January 31, 2018 at 8:57 pm

    An expression that was working fine before, in fact it still does in the previous files where I applied it, now it’s reporting ‘substr is not a function’ as an error.

    I didn’t change anything in the expression and haven’t updated my version of AE.

    Can anyone help me figure out this cryptic error?

    Thanks.

    L = text.sourceText.length;
    sp=thisComp.layer("xp").effect("Speed")("Slider");
    st=thisComp.layer("xp").effect("Start At")("Slider");
    PT = time - thisLayer.inPoint;
    T = PT*sp-st*sp;
    F = Math.round(PT % 1);

    if(F == 1 | (T0) )

    {Fl = "|"}
    else{Fl ="";}

    substr(0,T) + Fl

    David Cabestany replied 8 years, 6 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    January 31, 2018 at 10:26 pm

    Sorry for the silly question–you did apply this to a Source Text property, yes?

    Dan

  • David Cabestany

    January 31, 2018 at 11:55 pm

    No silly questions here.
    Yes, to the source text property

    Thanks,

  • Dan Ebberts

    February 1, 2018 at 1:08 am

    I’m not getting a “substr” error, but I do get an error about this line:

    if(F == 1 | (T0) )

    When I change it to this (just guessing):

    if(F == 1 | (T < 0) )

    I don’t get any errors, and the expression does something (not sure if it’s what you expect though).

    Dan

  • David Cabestany

    February 1, 2018 at 5:16 pm

    It sort of does what’s supposed to, but not quite.
    The idea is to add a blinking cursor at the end, but for it to be visible as the sentences gets written, the second slider would delay the beginning of the writing but the blinking cursor would be there from the very first frame.

    With your revision I’m not getting the error anymore but the cursor is not blinking before the text begins to write.

    I’ll manage with this.
    Thanks for your help Dan.

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