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

What is Framer? Join the Community
Return to index
Ethan Miller
Posted Mar 09 - Read on Facebook

Hey all, I'm trying to extend the Layer class in a way that I can create sub-layers on the fly and animate them. I'm having trouble with closure and scope. I've tried to read up on the subject and follow examples, but nothing's worked for me yet.

I want to:
- Generate layers based on an array of images
- Generate animations for those layers
- Generate event-triggers for the anims

I might be going about this the wrong way. Any advice appreciated!

I pared down this example to the basic parts:


Krijn Rijshouwer

Hey Ethan Miller,

I don't fully understand what you are trying to achieve, but I guess it's something like this → . If not, could you elaborate a little more on your end goal?

Ethan Miller

Thanks for the help, Krijn. That's super close to what I'm trying to do, except I want each one to animate independently on tap (when you tap each "Flipper", only that one animates.)

In other explorations I could only make them simultaneously animate, or just the last object would animate.

(sorry if the example's a little confusing).

Krijn Rijshouwer

Oops, I see, fixed it for you →

Ethan Miller

Aha! So much more straightforward than what I was trying to do. Thanks!

Krijn Rijshouwer

No problem man!

Krijn Rijshouwer

Aha, gotcha! Nice man, looking forward to see the finished prototype. :)

Read the entire post on Facebook