← BACK

You can use transitions by counter value when you need to break the flow in the demo, for example, to go to a specific scene outside the main flow and then return to where the user left off. The counter value in this case is the reference ID of the scene you want to return to. 

To set up a transition by counter value, you need to do the following:

  1. Create and set a counter to store the reference ID of the desired scene.
    Depending on our design, you may have to create several counters, one for each scene.
  2. Add a transition using the counter with the scene ID.

Tip:  It is a best practice to add all your counters earlier in the project, and then use them as needed throughout the demo. 

Below are step-by-step instructions and a use case example.

Set Counter Value to Scene ID
  1. Depending on whether you want to set a counter for a scene or gesture, do one of the following:
    • Select the scene in the Scenes panel, and in the Events & Actions panel, click Add an Action, and select Set Counter.
    • Select the gesture in the Layers panel or on the canvas, and in its Properties panel, click Add an Action, and select Set Counter.
  2. Keep the default On Enter event or click the At Time or On Exit event.
  3. In the displayed Set Counter action menu, in the Counter drop-down list, select New Counter.
  4. In the displayed dialog, enter a descriptive name for the counter without using special characters or capital letters and click OK.

    The new counter is automatically selected in the Counter drop-down list.

  5. Leave the Value field blank and in the Scene drop-down list, select the required scene.
    Its ID is automatically entered in the
    Value field.
  6. Save the project.

Add a Transition by Counter Value
  1. Go to Scenes and select a scene where you want to add the transition by counter value.
  2. Go to Events & Actions and in the Transitions section, click Add .
  3. In the Transition menu, click By Counter.
  4. In the Move to Scene by Counter drop-down list, select the counter you’ve defined as described above.
    The Move to Scene block in the Events & Actions panel changes to Move by counter value.

  5. Save the project.

In Path View, scenes with transitions by counter value appear disconnected from the main flow, with arrows pointing to an Undefined label. 

Use Case

A demo includes a Settings scene that the user should be able to open from anywhere in the demo. Upon tapping to exit the Settings scene, the user needs to return to the scene where he or she left off to resume the demo flow. 

To accomplish this, you need to do the following:

  1. For every scene in the demo from which you want to allow access to the Settings scene, in the Events & Actions panel, do the following:
    1. Set a counter, for example, named current_scene, keeping the default On Enter event setting.
    2. Select the current scene’s reference ID as its value.
      For example, click to see the counters for Scene 1 and Scene 2 below. 

       

  2. For the Settings scene, in the Events & Actions panel, do the following:
    1. Add a transition.
    2. In the Transition menu, click By Counter and select the current_scene counter.
      For example, as shown below. 

    3. Save the project.

With this setup the user can resume the demo flow from the scene where they left off.

Was this helpful?

Updated June 27, 2019
Tags: