Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Headache with simple operation.

  • Headache with simple operation.

    Posted by Madli Man on December 29, 2012 at 6:16 pm

    Hi again,

    why 1+6 = 16? but i want it 7

    here is my code. please help me. i try search nothing close.

    thank you.

    next=thisComp.layer("Null "+(thisLayer.name.substr(7,3))).name // get name
    numbre= up.slice(5)// take the number only is 1
    toNull= numbre+6; // plus

    toNull =16 //arhgggghhhhhhhhh

    Madli Man replied 13 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 29, 2012 at 6:58 pm

    Try this:

    toNull= parseInt(numbre,10)+6;

    When you add strings, they get concatenated (“1” + “1” = “11”). If you convert one string to an integer and then add a number to it, you’ll get a number (1 + 1 = 2).

    Dan

  • Madli Man

    December 29, 2012 at 7:14 pm

    thank you Dan for reply,

    i will a try around.

    thank you sir

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