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

What is Framer? Join the Community
Return to index
Bil Chamberlin
Posted Jul 20 - Read on Facebook

Why does this not work with one click? It cycles through them but only on multiple clicks, thanks

line.states =
a:
rotation:90
b:
scale:.5

line.onTap ->
line.stateCycle("a","b")

23 Comments

Ian McClure

It should work but you could try changing line.stateCycle to this.stateCycle

Aalok Trivedi

What o you mean by one click? Do you want the layer to rotate and scale at the same time?

Bil Chamberlin

It's not cycling through the animations, one after the other.

Bil Chamberlin

this.stateCycle("a", "b", "c") does the same thing, it animates each state but I need to click on it 3 times to cycle through the 3 states

Bil Chamberlin

I should only have to click once

Bil Chamberlin

is there a stateCycle bug?

Aalok Trivedi

it's because you're calling each property once. Once the scale is at 5, there's no other state that says to switch it back to 1

Aalok Trivedi
Bil Chamberlin

thanks I was doing a test, but what I need eventually will be two states for rotation so I can call them easily through an event:

Bil Chamberlin

line.states =
a:
rotation: 90
b:
rotation: 0

line.onTap ->
line.stateCycle("a","b")

Bil Chamberlin

its bizarre that this doesn't cycle through, thanks for all the help everyone

Aalok Trivedi

So I think what you want is for the layer to animate to the next state once the previous state has ended right?

Bil Chamberlin

i just want it to cycle through those two rotation states from one click

Bil Chamberlin

on one click = an object rotates clockwise 90, then it rotates counterclockwise 90

Bil Chamberlin

but I would like each rotation as a state so I can call them when ever I want, it just seems to be buggy

Bil Chamberlin

maybe ill restart

Aalok Trivedi

yea I figured, stateCycle is not the right method for this. try this https://framer.cloud/iCLjB

Bil Chamberlin

restarting didn't work

Bil Chamberlin

I'm going to download his sample files and see of that works

Bil Chamberlin

wait, his files do the same thing, I may have been confused, I thought one click cycled through all of the events

Bil Chamberlin

sorry folks, thanks so much for the help!!!!

Bil Chamberlin

thanks Aalok Trivedi !!!!

Darren Shiang

how about this
animation1.onAnimationEnd ->
layer1.states.switch("state1")
layer2.states.switch("state2")
layer3.states.switch("state3")

Read the entire post on Facebook