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

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

How do I access arrays/objects inside of the "states" object. I would really like to use the orderedStates and previousStates objects!

This screenshot: console.log( layerA.states )


George Kedenburg III

random guess, but did you try layerA.states._orderedStates[0]

Matt Wujek

For some reason, I thought that you didn't need the underscore. That's exactly it. Thanks George!

Tisho Georgiev

I'm not sure what you're trying to do, but the previous and next state names, as well as the entire states object are passed to the Event.StateWillSwitch and StateDidSwitch listeners as arguments.

Tisho Georgiev

Also, as a rule, try to avoid accessing properties prefixed with an underscore. They're supposed to be private and their names might change in future versions.

Read the entire post on Facebook