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

What is Framer? Join the Community
Return to index
Kurash Dmitry
Posted Jan 13 - Read on Facebook

Hey gang!

I'm completely new to framer and trying to build my first animation with it. And as you could guess, I require your assistance the great coffeeScript elders.

What I'm trying to achieve – is to imitate a loader. I want these two rectangles move right and left, for about 4 times.

I've added two states for each rectangle and trying to cycle through them and somehow add repeat:, but I don't know how, because stateCycle just goes to the first state and then nothing happens. What's the best way to do it? I could go for enormous amount of layer.animate and the layer.onAnimationEnd another layer.animate, but I feel that this is wrong.

Any guidance, elders?


Kurash Dmitry

Now I figured out that this works:
sketch3.loaderA.onStateSwitchEnd ->
sketch3.loaderA.stateCycle "leftA", "rightA"

But I don't know how to stop it, and it still doesn't feel right. I suppose there has to be something that says "go through states for 4 times and then stop".

Jacky Lee

Kurash Dmitry you can get better control using animation. I've made some comments in there to help you understand the logic, sing out if you need help!

Jacky Lee


Kurash Dmitry

Hey Jacky Lee didn't expect that quality of a reaction! Thanks for the file and help!

Read the entire post on Facebook