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

What is Framer? Join the Community
Return to index
Dan Clarke
Posted Aug 05 - Read on Facebook

Hi everyone, I'm working on a problem for a larger project and I was wondering if I could get some help?

Essentially I want to animate the state of 2 layers sequentially. To do this I've created the layers and then added them to an array. I then want to use a for loop to count using 'i' and if the array point matches 'i' then change the scale of that layer, if it does not match then do nothing (or a different scale).

Currently I have the loop working for changing the scale for matching array point, but it just runs through and matches both array points. using an 'else' statement throws an error of "unexpected indentation".

Any thoughts?

As a side note, can I alter the rate at which the for loop runs? My using Utils.delay in some way?

5 Comments

Bo Jan

I am not sure if I got your problem, but I tried to solve it as follows — http://share.framerjs.com/uhlercffkfad/

Dan Clarke

Hi Bo Jan, that's looking pretty much like what I need, however I'd like that animation to loop over and over? But Framer tells me not to use 'while' or 'do while' loops...

Lee Jungyoung

There is a 'Utils.interval' function which calls a function every x sec. Hope this simple code help ( I just added 3 lines to Bo Jan's revision )
http://share.framerjs.com/eadr2kpsfcb1/

Bo Jan

Nice @Jung Young Lee. Didn't get the looping part hahah. Good job

Dan Clarke

Thanks Lee Jungyoung!

Read the entire post on Facebook