FORUMS: list search recent posts

Headache with simple operation.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Madli Man
Headache with simple operation.
on Dec 29, 2012 at 6:16:37 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




Return to posts index

Dan Ebberts
Re: Headache with simple operation.
on Dec 29, 2012 at 6:58:28 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



Return to posts index

Madli Man
Re: Headache with simple operation.
on Dec 29, 2012 at 7:14:50 pm

thank you Dan for reply,

i will a try around.

thank you sir



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]