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

What is Framer? Join the Community
Return to index
Josh Ackerman
Posted Jun 17 - Read on Facebook

Hello, I feel like this question has an obvious solution, although I am wondering why only one of the buttons is switching states? Here is the project


Chris Camargo

Hey Josh, take a look at this solution. I fixed your problem and tried to add as much commentary as possible in the code. Let me know if this makes sense!

Josh Ackerman

Thanks! One more question, what is the purpose of the [0] in the statements like layer.subLayersByName("offText")[0].states.switch("invisible")?

Chris Camargo

layer.subLayersByName() actually returns an array. You need to select the first (and hopefully only) object in that array. Arrays have a zero based index, so that's [0].

Read the entire post on Facebook