Copy link to clipboard
Copied
In a linked in learning course, there was this example expression...
It wasn't really explained well... the syntax for the b variable of the array index ([1]) on the wiggle function perhaps just shows my lack of javascript (?) familiarity.. but can someone explain how this index on the scale property is being 'used' by the wiggle function?
Perhaps asking a slightly different way... why does removing the array index ([1]) from the wiggle function cause an error on the FIRST line of code?
while omitting that b= assignment statement altogether resolves the error? It seems counter intuitive for modification in the second line like above to cause an error to the first line, and I'd like to understand what is going on so if/when I encounter other errors, I have a better understanding of how the system as a whole is functioning.
Copy link to clipboard
Copied
Properties in After Effects that have two values, for example scale height and scale width, use an array in expressions.
in the expression you have:
So by removing the [1], you're setting the scale to be [a,[50,50]] which is an array too far.
Hope that makes sense
Copy link to clipboard
Copied
I think that makes sense... but doesn't help me understand why it tells me the error is in line 1, where I'm assigning the value of 'a' w/ array index [0].
Copy link to clipboard
Copied
The error message is incorrect and not very helpful. Sometimes you can get better/more info by temporarily switching to the Legacy ExtendScript expression engine (File > Project Settings > Expressions), but in this case it will tell you that the error is in line 0.
Copy link to clipboard
Copied
Do you mean that the legcy engine will tell me the error is in line 0.. which is equally unhelpful?
Copy link to clipboard
Copied
Yes, in this case, using the legacy engine doesn't help. It's actually becoming less and less useful as a debugging tool because you have to avoid using new features of the language which aren't supported by the legacy engine. Dealing with the error messages from the new engine can be frustrating - especially the situation where, with a large expression, you might get an error with a reported line number beyond the end of the expression. I do wish they'd fix that...
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more