This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
George Otsubo
Posted Nov 04 - Read on Facebook

Trying to loop back and forth through an array of colors: red -> orange -> green, green -> orange -> red in an infinite loop but stuck on how to reverse through an array? I can cycle through using Utils.cycle but is there a way to listen to when the cycle ends then reverse and start cycle?


Anton Kartashov

Hey! You can use Utils.cycle not for colors, but for their indexes. And make array.reverse() on each iteration.

George Kedenburg III

or you can just make your array in a way that it does the reversing for you: i.e. [A, B, C, B] which will look like its reversing when you loop through it

Read the entire post on Facebook