# Having trouble with For loops

**URL:** <https://forum.kirupa.com/t/having-trouble-with-for-loops/303767>\
**Category:** Uncategorized\
**Created:** [January 26, 2010, 7:55pm UTC](https://forum.kirupa.com/t/having-trouble-with-for-loops/303767 "2010-01-26T19:55:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lletdownl](https://avatars.discourse-cdn.com/v4/letter/l/6a8cbe/32.png) [@lletdownl](https://forum.kirupa.com/u/lletdownl)\
**Post date:** [January 26, 2010, 7:55pm UTC](https://forum.kirupa.com/t/having-trouble-with-for-loops/303767/1 "2010-01-26T19:55:31Z")

</div>

hi everyone… im wondering if someone could offer me some direction with the execution of this for loop.

here is the basic premise…

```auto
function DisableTMBS (){
	for(i=1; i<20; i++){
		var TMBSOff="_root.mc_tmbsPanel.mc_TMBS.mc_tmb"+i
		TMBSOff.enabled=false;
	}
}

_root.textbutton.onPress=function(){
	DisableTMBS();
}

```

i need to disable a string of thumbnails which are organized in a scorllable panel… but i need them to remain visible.  
When i trace “TMBSOff”, i get appropriate values…  
\_root.mc\_tmbsPanel.mc\_TMBS.mc\_tmb1… and so on and so on… but turning those movie clips off through that variable does not work.

how would i achieve this? any direction would be really appreciated…
