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

What is Framer? Join the Community
Return to index
Rohan K
Posted Aug 01 - Read on Facebook

[SOLVED] Sorry I am back with yet another question. Just trying to understand the FlowComponent, specifically the transition function.

The Docs suggest that layerA.onClick ->flow.transition(layerB, scaleTransition)
should transition from layerA to layerB using the custom scaleTransition.

But, what if my the event is not on LayerA but on another layer. Can I pass layer A (in addition to layer B) as an argument to the transition function? Or will it only just use the layer from which the event originated?


Ian McClure

Yes, you can pass any layer you want into flow.transition. However, layerA.onClick() will only fire when layerA is clicked. To have this work on another layer you'd need to make an onClick event for that layer.

layerA.onClick ->
flow.transition(layerB, scaleTransition)

you'd need a new event for layerB—for example—so you'd add this to your code:

layerB.onClick ->
flow.transition(layerN, scaleTransition)

Rohan K

Ian McClure I am sorry I didn't quite follow your suggestion, maybe I was unclear. Simply put, I want the flow component to custom transition from the current layer, LayerA, to another layer, Layer B, when I click/tap/whatever on a third layer, layer C.

Rohan K

OK I see what's going on, I think the transition is working fine, but the since my layers are actually art boards in sketch. They are placed all over the place. So while the transition is happening, it is not moving the destination artboard to 0,0, as a result the transition is happening outside the screen where I can't see it! Looks like i'll have to specify x and y values as well... but I dont want the x and y values to animate, else the art boards will be flying in from everywhere. 🤔

Ian McClure

You should be able to access them as a property of the sketch import then assign the x and y coordinates as you wish.

Read the entire post on Facebook