title: Looping through array and setting visible property of instances - ActionScript3
body: <p>I have variable names stored in an array, and I want to loop through array and set the visible property of that instance to false. However, I'm getting error;</p>
  
  <blockquote>
    <p>Error #1056: Cannot create property visible on String.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>package  {
      import flash.events.TouchEvent;
      import flash.ui.Multitouch;
      import flash.ui.MultitouchInputMode;
      import flash.display.MovieClip;
      import flash.events.MouseEvent;
  
      public class touch extends MovieClip
      {
          public function touch()
          {
              var menuitems:Array = new Array("menu_One", "menu_Two", "menu_Three", "menu_Three", "menu_Four", "menu_Five");//array with instance names
              for(var i:int=0;i&lt;6;i++){
                  var tempName = menuitems[i];
                  bsF_txt.text = tempName;
                  trace(tempName);
                  tempName.visible = false;
                  //menu_One.visible = false;
              }
  
           }
        }
  }
  </code></pre>
  
  <p>Is. what  I'm trying to do possible in AS3?</p>