I am trying to make the elements of a Text array fade away one by one in a for loop, but for some reason they fade away together.
Here is the code:
for (int i = 0; i < citiesText.length; i++) {
if (i != cityNum) {
PauseTransition pause = new
PauseTransition(Duration.millis(3000));
FadeTransition ft = new FadeTransition(Duration.millis(3000), citiesText[i]);
SequentialTransition st = new SequentialTransition(pause, ft);
ft.setFromValue(1);
ft.setToValue(0);
st.play();
}
}