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

What is Framer? Join the Community
Return to index
Arvi Raquel-Santos
Posted Aug 25 - Read on Facebook

Can I create an array for animationOptions? I tried this and it didn't work... but then again, I'm not sure if it's written correctly.

array = [layerA, layerB]

for layers in array
states.animationOptions =
curve: "linear(600,40,20)"

4 Comments

George Kedenburg III

youd need to do
for layer in array
layer.states.animationOptions =
etc.

Arvi Raquel-Santos

Gonna ask a really dumb question here since I'm lacking in sleep and focus right now but what does "layer" refer to when you are coupling this with animation states?

George Kedenburg III

all the code in a for loop runs once for each item in the array, but you need a generic name to call each item when it comes through the code...

so saying "for thing in array" just means that "thing" is the thing you want to access in your code

Jordan Robert Dobson

I do this all the time too...

layer.center() for layer in [layerA, layerB, layerC]

You don't really need to make an array variable... You can just put an array where you are placing the "array" variable... So like this:

for layer in [layerA, layerB]
layer.states.animationOptions =
curve: "linear(600,40,20)"

Read the entire post on Facebook