Skip to main content
Loops
Updated over a week ago

Loops in Play allow you to apply one action multiple times. We have two types of Loops: Loop Children and Loop. If you’re familiar with For Loops in code, Play’s Loops should be intuitive.

Loop Children

A Loop Children node allows you to target each child of a selected container using a single action.

For example, let’s say you have a V stack with six cards inside, and you want to set the width of all six to 20 pt. Instead of adding six Set Width actions, each targeting a different card, you can use one Loop Children node with a single Set Width action.

Loops also make testing different variations quicker. Just iterate on one action, rather than changing six actions for every new idea.

Here are the properties of Loop Children:

  • Parent: Select the stack or page containing the children you’d like to loop through

  • Index: Select the order the Loop should loop through. Options include:

    • Forward: the Loop starts at index 0 then 1, 2, 3, and so on until the final child’s index

    • Reverse: the Loop starts at the final child’s index and works backward to 0

    • Random Once: the Loop cycles through the indices randomly once

    • Random: the Loop cycles through the indices randomly

Loop

A Loop node iterates through a range of numeric values (from Start to End) that can be used in an action.

  • Start: Select the first number of your Loop. This number will be indexed at 0.

  • End: Select the last number of your Loop.

  • Index: Select the order the Loop should loop through. Options include:

    • Forward: the Loop starts with the Start value and ends with the End value

    • Reverse: the Loop starts at the End value and works backward to the Start value

    • Random Once: the Loop cycles through the indices randomly once

    • Random: the Loop cycles through the values randomly

Did this answer your question?