Elizabeth Dobrovolskaya2021-10-01 16:55:47
Elizabeth Dobrovolskaya, 2021-10-01 16:55:47

After Effects: Undefined value used in the expression(Could be out of range array subscript). What could be the problem?

I need your help please. Now I'm studying the topic "Expressions in After Effects" and I needed to create such a scale that would change its color when the value changes, but it gives me such an error. What could be the problem?

I'm attaching a gif that should turn the description of the external image here.

What I have: 6157130460f6f320721245.png

The expression I used:
x = thisComp.layer("text").effect("Slider Control")("Slider");
if (x<=30){effect("low")("Color")}
if (x>30&&x<70){effect("middle")("Color")}
if (x>=70){effect ("high")("Color")}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Evgeny Golubev, 2022-01-04

You have clearly written - an error in the first line.
This happens if the expression is used in English, and the program, for example, in Russian.
I had it. There was a Russian version and the effect acc. was called in Russian, and in the expression there was something like Effect fade - it gave an error because it did not find such an effect. This is where you smoke.
Undefined value - Undefined value. He does not understand what you wrote to him. He does not understand "color", and the layer most likely has a color value of fill, and not color

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question