title: Flex 3: Hiding elements created by repeater
body: <p>I have a repeater that creates a custom component named "Block."  I need to make it so that when the user clicks a button, all of the blocks created by the repeater have their visible field set to false (and then true when the button is clicked again).</p>
  
  <p>Here's some of the code I have right now:</p>
  
  <pre><code>&lt;mx:Repeater id="indPositions" dataProvider="{projectPositions}" startingIndex="0"&gt;
          &lt;components:block height="24"
              width="100%" id="thisBlock" visible="true" horizontalScrollPolicy="off"  
              oneDay="{oneDay}"
          /&gt;
      &lt;/mx:Repeater&gt;
  </code></pre>
  
  <p>Here's the button the user will click to show/hide the blocks:</p>
  
  <pre><code>&lt;mx:Button id="showHideButton" label="Show Project" x="{addBlock.x + addBlock.width + 2}" click="showProjectSwitch();" /&gt;
  </code></pre>
  
  <p>Here's the function showProjectSwitch():</p>
  
  <pre><code>public function showProjectSwitch():void {
              if (showHideButton.label == "Hide Project")
              {   
                  showHideButton.label = "Show Project";
                  indPositions.visible = false;
                  thisProject.height = 65;
              }
              else
              {   
                  showHideButton.label = "Hide Project";
                  indPositions.visible = true;
                  thisProject.height = projectHeight ;
              }
          }
  </code></pre>
  
  <p>I tried setting projectRP.visible="true/false", but it didn't work :(</p>
  
  <p>I also tried wrapping a canvas around the repeater, but when I did that... the repeater only ran once despite the fact I have the startingIndex="0" and the count="16".  I then removed the canvas tags and the repeater ran the correct number of times.</p>
  
  <p>Anybody able to help me out?</p>