Math Syntax not working (add)
Posted: January 26th, 2009, 7:42 pm
I've created this:
var myposY = newComp.height*.5 // center on comp height
var myposX = newComp.width*.5 // center on width
var myposOffset = myposY+myOffset
newComp.layer(1).property("Position").setValue([myposX, myposOffset]);
because when I tried
newComp.layer(1)property("Position").setValue([320,240+myOffset]);
but I still get the wrong result.
I would always get 240 plus the value of myOffset added as a 4th integer.
•If myOffset = 2, then the value would become "2402" not "242"
dunno what I'm doing, so I don't know what I'm doing wrong.
thx!
I just figured out that all of my "setValues" need capital "V"s... so I'm sure it's just a newbie syntax error, but I don't know where.
var myposY = newComp.height*.5 // center on comp height
var myposX = newComp.width*.5 // center on width
var myposOffset = myposY+myOffset
newComp.layer(1).property("Position").setValue([myposX, myposOffset]);
because when I tried
newComp.layer(1)property("Position").setValue([320,240+myOffset]);
but I still get the wrong result.
I would always get 240 plus the value of myOffset added as a 4th integer.
•If myOffset = 2, then the value would become "2402" not "242"
dunno what I'm doing, so I don't know what I'm doing wrong.
thx!
I just figured out that all of my "setValues" need capital "V"s... so I'm sure it's just a newbie syntax error, but I don't know where.