title: How to make a movie clip visible if only five movie clips (not more) are clicked
body: <p>I have 25 movie clips on stage and they all can be clicked and colored. I want a movie clip named text_mc to became visible if only 5 specific buttons from those are clicked and colored - not more. If the user choose more than those five movie clips (even thought that 5 movie clips are included)  then the movie clip named text_mc should stay invisible. I can' t do the last part: if more than those 5 specific movie clips are clicked then the text_mc should stay invisible. Can you please help me? This is my code </p>
  
  <pre><code>  stop();
  
    import flash.display.MovieClip;
  
  
  
   var sximata:MovieClip = square1;
   import flash.display.MovieClip;
   import flash.events.MouseEvent;
   import flash.geom.ColorTransform;
  
  
  
   text_mc.visible=false;
  
  
    square1.addEventListener(MouseEvent.CLICK, onsquare1);
    function onsquare1(e:MouseEvent):void {
  sximata = square1;
    }
  
  
    square2.addEventListener(MouseEvent.CLICK, onsquare2);
    function onsquare2(e:MouseEvent):void {
  sximata = square2;
    }
  
    square3.addEventListener(MouseEvent.CLICK, onsquare3);
    function onsquare3(e:MouseEvent):void {
  sximata = square3;
    }
  
  
    square4.addEventListener(MouseEvent.CLICK, onsquare4);
    function onsquare4(e:MouseEvent):void {
  sximata = square4;
     }
  
  
    square5.addEventListener(MouseEvent.CLICK, onsquare5);
    function onsquare5(e:MouseEvent):void {
  sximata = square5;
     }
  
     square6.addEventListener(MouseEvent.CLICK, onsquare6);
     function onsquare6(e:MouseEvent):void {
  sximata = square6;
        }
  
      square7.addEventListener(MouseEvent.CLICK, onsquare7);
      function onsquare7(e:MouseEvent):void {
  sximata = square7;
       }
  
  
      square8.addEventListener(MouseEvent.CLICK, onsquare8);
       function onsquare8(e:MouseEvent):void {
  sximata = square8;
  square8Clicked = true;
  checkButtons();
  
  
     }
  
     square9.addEventListener(MouseEvent.CLICK, onsquare9);
     function onsquare9(e:MouseEvent):void {
  sximata = square9;
  square9Clicked = true;
  checkButtons();
     }
  
  
      square10.addEventListener(MouseEvent.CLICK, onsquare10);
      function onsquare10(e:MouseEvent):void {
  sximata = square10;
  square10Clicked = true;
  checkButtons();
       }
  
  
       square11.addEventListener(MouseEvent.CLICK, onsquare11);
       function onsquare11(e:MouseEvent):void {
  sximata = square11;
      }
  
  
         square12.addEventListener(MouseEvent.CLICK, onsquare12);
         function onsquare12(e:MouseEvent):void {
  sximata = square12;
       }
  
      square13.addEventListener(MouseEvent.CLICK, onsquare13);
        function onsquare13(e:MouseEvent):void {
  sximata = square13;
  square13Clicked = true;
  checkButtons();
      }
  
  
     square14.addEventListener(MouseEvent.CLICK, onsquare14);
     function onsquare14(e:MouseEvent):void {
  sximata = square14;
  square14Clicked = true;
  checkButtons();
      }
  
  
       square15.addEventListener(MouseEvent.CLICK, onsquare15);
       function onsquare15(e:MouseEvent):void {
  sximata = square15;
       }
  
      square16.addEventListener(MouseEvent.CLICK, onsquare16);
       function onsquare16(e:MouseEvent):void {
  sximata = square16;
       }
  
     square17.addEventListener(MouseEvent.CLICK, onsquare17);
     function onsquare17(e:MouseEvent):void {
  sximata = square17;
       }
  
  
      square18.addEventListener(MouseEvent.CLICK, onsquare18);
      function onsquare18(e:MouseEvent):void {
  sximata = square18;
         }
  
      square19.addEventListener(MouseEvent.CLICK, onsquare19);
      function onsquare19(e:MouseEvent):void {
  sximata = square19;
       }
  
  
       square20.addEventListener(MouseEvent.CLICK, onsquare20);
       function onsquare20(e:MouseEvent):void {
  sximata = square20;
        }
  
  
       square21.addEventListener(MouseEvent.CLICK, onsquare21);
       function onsquare21(e:MouseEvent):void {
  sximata = square21;
        }
  
  
      square22.addEventListener(MouseEvent.CLICK, onsquare22);
      function onsquare22(e:MouseEvent):void {
  sximata = square22;
        }
  
      square23.addEventListener(MouseEvent.CLICK, onsquare23);
      function onsquare23(e:MouseEvent):void {
  sximata = square23;
        }
  
  
      square24.addEventListener(MouseEvent.CLICK, onsquare24);
       function onsquare24(e:MouseEvent):void {
  sximata = square24;
         }
  
  
       square25.addEventListener(MouseEvent.CLICK, onsquare25);
        function onsquare25(e:MouseEvent):void {
  sximata = square25;
         }
  
  
  
  
      var myColorTransform:ColorTransform=transform.colorTransform;
      red_btn.addEventListener(MouseEvent.CLICK, changeColour);
      function changeColour(event:MouseEvent):void {
  
  
      myColorTransform.color=0xBD8D46;
  
      sximata.transform.colorTransform=myColorTransform;
  
  
     }
  
  
       resetButton.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
  
       function fl_MouseClickHandler(event:MouseEvent):void
       {
      gotoAndPlay(1);
         }
  
  
  
  
     var square8Clicked:Boolean = false;
     var square9Clicked:Boolean = false;
     var square10Clicked:Boolean = false;
     var square13Clicked:Boolean = false;
     var square14Clicked:Boolean = false;
  
  
       function checkButtons():void
  {
  if(square8Clicked &amp;&amp; square9Clicked &amp;&amp; square10Clicked &amp;&amp; square13Clicked &amp;&amp; square14Clicked)
      {
      text_mc.visible = true;
  
     }
  }
  </code></pre>