# Use variable in setting \_visible \[as2\]

**URL:** <https://forum.kirupa.com/t/use-variable-in-setting--visible-as2/279760>\
**Category:** Uncategorized\
**Created:** [January 19, 2009, 12:31am UTC](https://forum.kirupa.com/t/use-variable-in-setting--visible-as2/279760 "2009-01-19T00:31:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olaf\_Forkbeard](https://avatars.discourse-cdn.com/v4/letter/o/c89c15/32.png) [@Olaf\_Forkbeard](https://forum.kirupa.com/u/Olaf_Forkbeard)\
**Post date:** [January 19, 2009, 12:31am UTC](https://forum.kirupa.com/t/use-variable-in-setting--visible-as2/279760/1 "2009-01-19T00:31:13Z")

</div>

(Problem sovled)

I wasn’t sure where to post this, seeing how its kind of a plain programmatic question, but I need to for a game I am creating. At one point in time in my rugged form of learning this language I learned and promptly forgot how this would work. Is their not a way to use i in this statement below to make it so that I may have this.menu\_mc.miniMap\_mc.mmi\_mc.\_visible = false; where I is numbers 1-24. In the end this makes 24 movie clips visibility to false.

```auto

totalRooms = 24;
//set all the visibility of mini map to false
for(var i = 1; i < totalRooms+1; i++)
{
    this.menu_mc.miniMap_mc.mm i _mc._visible = false;
}

```

There ya have it, My memory tells me it was an in statement or something but I couldnt find it in the help docs in flash.
