For updates, you should follow me on

Using repeat loops in buttons

  Live in v2.0  

The loop command allows you to repeat button actions a set number of times.  Everything should work with the loop command except user inputs - which are dealt with before all other button actions.  The command and parameters are;




A special loop counter variable is created ( $@ ) which you can use in your commands.



The following ipad screenshots show the commands used for a wave effect.  There are five boxes (color sources) at the bottom of the screen (Box1 ... Box5).  The boxes are side by side, filling the width of the screen.







Since there are 5 boxes, the loop counter will repeat from 1 to 5...






To create the wave effect, each box has a slightly longer delay before it starts to move - using the loop couter variable $@ multiplied by 100 (millisecs).  Note that the animation queue is enabled for each object so that any animation performed on it is finished before another begins.  Also note the brackets around the change to the y position : indicating that the change is relative to its current position.






Since the animation queues are enabled, we can simply animate the box back to its original position - this animation will trigger when the previous animation is complete.


Prev: Setting custom values to use in the deck  
Next: Using math expressions

© 2019