# For loop, update variabel ewery time it hits 3

**URL:** <https://forum.kirupa.com/t/for-loop-update-variabel-ewery-time-it-hits-3/192303>\
**Category:** Uncategorized\
**Created:** [June 27, 2006, 5:37pm UTC](https://forum.kirupa.com/t/for-loop-update-variabel-ewery-time-it-hits-3/192303 "2006-06-27T17:37:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rille31](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rille31](https://forum.kirupa.com/u/rille31)\
**Post date:** [June 27, 2006, 5:37pm UTC](https://forum.kirupa.com/t/for-loop-update-variabel-ewery-time-it-hits-3/192303/1 "2006-06-27T17:37:12Z")

</div>

Hi guys

I wanna do a gallery that loads 3 thumbnails next to each other and ewery 3th time I wanna update \_y and \_x positions of the duplicated clip.

Example

![](http://www.rille.net/bilder.jpg)

So the first 3 times I wanna update a variabel for \_x, after the 3th time reset it and update a variabel for \_y.

I could do this with some if statements but I dont know how many images there will be.

Anybody got any ideas:look:

Edit: I thought that putting counter variabels outside the loop and put one if should do it.  
if(counter==3){  
counter=0;  
}
