Forum Discussion

ArjanWeise1's avatar
ArjanWeise1
Community Member
7 days ago

Layer swipe and button conflict

Your support please.

I have created a Project that allows swiping between layers. For users on devices that don't allow swiping I created buttons. But now if you use the buttons on a touch screen it randomly proceeds multiple layers (so it does not advance one but two). Or when ticking back it goes back one and advances one. 

Swipe test


To enable swiping, I:

created a variable to activate the layer that should be visible

created the layers

added a swipe trigger on the base layer: 

On the base layer:

  • Swipe Left → Next Layer

o   Action: Adjust variable

o   Variable: Layer

o   Operation: Add 1

o   When: User swipes left

o   Condition: currentLayer < 5.

  • Swipe Right → Previous Layer (optional)

o   Action: Adjust variable

o   Variable: Layer

o   Operation: Subtract 1

o   When: User swipes right

o   Condition: currentLayer > 1.

Added Triggers to Show Layers

On the base layer, create triggers that fire when Layer changes:

  • **Show Layer1 when **Layer == 1
  • **Show Layer2 when **Layer == 2
  • … repeat for all layers.

Trigger settings:

  • Action: Show layer
  • When: Variable changes
  • Variable: Layer
  • Condition: Layer == X.

Did the same for the navigation buttons (same logic)

Added a  Backup Function (Sync Variable on Timeline Start)

On each layer:

  • Add a trigger:

o   Action: Adjust variable

o   Variable: currentLayer

o   Value: X (the layer number)

o   When: Timeline starts on this layer.

This ensures that if a learner jumps to a layer by another method (e.g., menu), the variable stays in sync.

2 Replies

  • Hello ArjanWeise1​
    Thanks for reaching out!  I tested your Review link on my end, and was able to successfully swipe from slide to slide without that jumping behavior you described. I'd like to learn more!

    • What device are your learners viewing this course on? I'm curious if this issue is only occurring in a mobile phone or perhaps on a tablet. 
    • Are your learners viewing this in Review 360 or another publishing option?  It would also be helpful to know the browser(s) being used if in a web environment.

     

    We'd be happy to take a closer look at your .story file and a screen recording of this behavior to continue troubleshooting. You can share these materials in this thread or privately in a support case

    Looking forward to hearing from you! 

  • I would suspect this is a trigger order/timing issue.

    You show the layer and then subtract one or add one, but you also set the value on timeline start of the layer.

    The layer is loading and then the trigger fires to add one which adds to the layer you have just shown. Because the nav triggers are on the baselayer they will fire in order.

    Solution? I am not sure you could change the trigger order or just have the swipe add and subtract andthen show the layer when the variable changes and use the same function for the other method of showing the layer