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.
Math Syntax not working (add)
Moderator: Paul Tuersley
- lloydalvarez
- Enhancement master
- Posts: 460
- Joined: June 17th, 2004, 9:27 am
- Location: New York City, NY
- Contact:
Hey Ko,
When you see that you need to tell the script to interpret myOffset as an integer not a string:
-Lloyd
When you see that you need to tell the script to interpret myOffset as an integer not a string:
Code: Select all
parseInt(myOffset,10);
-Lloyd
- lloydalvarez
- Enhancement master
- Posts: 460
- Joined: June 17th, 2004, 9:27 am
- Location: New York City, NY
- Contact:
Yep.is this a base-10 thing?