-
Storing a list of properties in a variable
I have a list of properties that I want to iterate through to see if they are keyed:
var testLayer = compItem.layer(1); var testProps = ["Position", "Opacity"]; //This line returns the correct number of position keys on the first layer $.writeln(testLayer.Position.numKeys); //This line returns the correct number of opacity keys on the first layer $.writeln(testLayer.Opacity.numKeys); //Both of these lines error out as "undefined is not an object" $.writeln(testLayer.testProps[0].numKeys); $.writeln(testLayer.testProps[1].numKeys);
Why is it that I am able to access each property’s keys by directly putting in the string name, but putting that same string in a variable returns undefined?
Thanks!