# Setting multiple movieclip properties via a for loop

**URL:** https://forum.kirupa.com/t/setting-multiple-movieclip-properties-via-a-for-loop/316787
**Category:** flash
**Created:** [December 2, 2010, 12:23pm UTC](https://forum.kirupa.com/t/setting-multiple-movieclip-properties-via-a-for-loop/316787 "2010-12-02T12:23:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dt01](https://avatars.discourse-cdn.com/v4/letter/d/c0e974/32.png) [@dt01](https://forum.kirupa.com/u/dt01)
#### Post date: [December 2, 2010, 12:23pm UTC](https://forum.kirupa.com/t/setting-multiple-movieclip-properties-via-a-for-loop/316787/1 "2010-12-02T12:23:24Z")

</div>

Hi,

I have 35 movieclips, named s1, s2, s3 etc, depending on the value of currentDisplay, I would like to set a movieclip visible property to true while the others are set to false, I have tried the following:

```auto
for (i=1; i<36; i++){
    trace(i);
    if (i == currentDisplay){ // CurrentDisplay indicates which movieclip should be visible
        ["s" + i].visible = true // Show movieclip
    } else {
        ["s" + i].visible = false // Hide movieclip
    } 
}

```

but I receive an error message:

1083: Syntax error: dot is unexpected.

I assume it is referring to the dot before visible, if someone could lead me in the  
right direction that would be great, thanks.
