# How to repeat a for loop?

**URL:** https://forum.kirupa.com/t/how-to-repeat-a-for-loop/151098
**Category:** flash
**Created:** [June 13, 2005, 10:48am UTC](https://forum.kirupa.com/t/how-to-repeat-a-for-loop/151098 "2005-06-13T10:48:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Loque](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@Loque](https://forum.kirupa.com/u/Loque)
#### Post date: [June 13, 2005, 10:48am UTC](https://forum.kirupa.com/t/how-to-repeat-a-for-loop/151098/1 "2005-06-13T10:48:38Z")

</div>

Hey all,

as you can probably tell by my post count, i am new! 😃 // lo to all! I have been registered here for while and i always check out what peeps are saying here with little time to post. Loving the tutorials as well… very nice!

However my knowledge of AS is weak, i have kinda started form the back in as well - as i know a few people that code a lot and look at their source - whilst myself i studied music at uni etc…

anyway cutting to the chase, i need some advice and was wondering if someone could spare a mo to briefly explain what i should do here…

```auto

for (i=0; i<7; i++) {

	this["bubble"+i]._x = 0;
	this["bubble"+i]._y = 0;
	this["bubble"+i]._xscale = 0;
	this["bubble"+i]._yscale = 0;
	this["bubble"+i]._alpha = 100;

	this.randomVarX = random(80)+50;
	this.randomVarY = random(20)-80;
	
		this["bubble"+i].alphaTo(0, 5, "easeOutQuad", 0);
		this["bubble"+i].scaleTo(100, 1, "easeOutQuad", 0);
		this["bubble"+i].slideTo(randomVarX, randomVarY, 2, "easeOutQuad", 0);
}

```

I am using Laco code to move my sweet bubbles around, however after the last one has reached an alpha level of about 10 i would like the loop to repeat the for loop. Basic stuff i am sure? Was considering a callback from the last line of laco, or placing an if statement to call an action.

any help is appreciated!

Løque
