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

What is Framer? Join the Community
Return to index
Nick Bewley
Posted Oct 28 - Read on Facebook

Is there a way to create states that would be a combination of other elements' states..? If I had a dog and a cat, for example, and wanted to position them at different locations throughout an interaction, it would be much easier to say something like:

__fighting: {cat.y: 1120, dog.y: 220}
__barking: { cat.y: 333, dog.y: 31221 }

rather than:

__fighting: {y: 1120}
__barking: {y: 333}

__fighting: {y: 220}
__barking: {y: 31221}



Koen Bok

This is pretty smart :-)

There currently is not. I'm thinking about how to make a state-state machine a lot. You are too, it seems.

I'm just trying to find the right balance between simplicity and some other future things that are dependent on this.

For now my favorite way to do this is just create groups that have states with the same names and do something like:

_.invoke(layerGroupArray, "switch", "state-name")

Koen Bok

If you wonder where the invoke comes from it's lodash, which is included in Framer:

Nick Bewley

Yes, thanks Koen. Your _.invoke approach is exactly what I am looking for.. Thanks a ton!

Read the entire post on Facebook