Expression error, beating my head
In an expression I'm trying to access a layer by index based on a calculation:
laynum = (index-1) - Math.floor(time);
craplayer = thisComp.layer(laynum);but I keep getting the error "layer index -1 out of range" on that second line -- yet if I return laynum in my expression to look at the value, it's 3.0 which is correct in my case (expression is on a numeric property on layer 4, while sitting on frame 0 of the comp.)
If I do:
laynum = 3.0;instead of my calculation, it works fine. I'm just not seeing what the difference is, why this isn't working. I'm using the Javascript expression engine, not the old ExtendScript.
