# Loop function

**URL:** https://forum.kirupa.com/t/loop-function/65639
**Category:** flash
**Created:** [September 28, 2004, 10:51am UTC](https://forum.kirupa.com/t/loop-function/65639 "2004-09-28T10:51:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mitja2](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@mitja2](https://forum.kirupa.com/u/mitja2)
#### Post date: [September 28, 2004, 10:51am UTC](https://forum.kirupa.com/t/loop-function/65639/1 "2004-09-28T10:51:11Z")

</div>

Is there any way to do this code with less lines - with usage of WHILE or FOR or some other LOOP function.

progBar1.\_xscale=0;  
progBar2.\_xscale=0;  
progBar3.\_xscale=0;  
progBar4.\_xscale=0;  
progBar5.\_xscale=0;  
progBar6.\_xscale=0;  
progBar7.\_xscale=0;  
progBar8.\_xscale=0;  
progBar9.\_xscale=0;  
progBar10.\_xscale=0;

All there is changing is progbar number in name.  
Any ideas?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 28, 2004, 1:06pm UTC](https://forum.kirupa.com/t/loop-function/65639/2 "2004-09-28T13:06:23Z")

</div>

you the following actions:

```auto

for(i=0; i&lt;11; i++){
	_root["progBar"+i]._xscale = 0;
}
```
