title: Loop as3; function intersects; onEnterFrame
body: <p>On the stage I have a three kind of movieclips
  Few static movieclips whose name is: mc1; mc2; mc3....  them are visible on stage
  Few static movielips" othermc1; othermc2l othermc3... and them have "visible = false"
  One movieclip whose is moving on the stage and his name is "slider"
  I have function when mc "slider" intersects one of the rest of mc1, mc2... to turn visible othermc1, othermc2</p>
  
  <pre><code>var alreadyHandled:Boolean = false;
  
  addEventListener(Event.ENTER_FRAME, onEnterFrame);
  
  function onEnterFrame(e:Event):void
  {
      if(mc1.getRect(this).intersects(slider.getRect(this)))
      {
          if(!alreadyHandled)
          {
              show1();
              alreadyHandled = true;
          }
      }
      else
      {
          alreadyHandled = false;
          no1();
      }
  
  function show1():void
  {
      othermc1.visible = true;
  }
  function no1():void
  {
      othermc2.visible = false;
  }
  </code></pre>
  
  <p>How can i use this code in loop?
  Thanks for help</p>