1 Reply Latest reply on Dec 9, 2011 7:06 AM by kglad

    Make something happen after 4 MCs Play

    dan_loffler

      Hi,

       

      I need to have 4 buttons that play 4 different MCs. I want a 5th MC to play after all 4 MCs have been played. Any ideas on how to do this in AS2?

       

      Thanks.

       

      Dan

        • 1. Re: Make something happen after 4 MCs Play
          kglad Adobe Community Professional & MVP

          :

           

          var n:Number = 0;

          var btnNum:Number = 4;

           

          // assign each button a property (eg, ivar) that's = 1 for your first button, 2 for your 2nd etc.

          // each buttons mouse handler should call the function below and pass that property value

           

          function buttonF(i:Number):Void{

              n = Math.max(n,n ^ (1 << i));

              if(n==Math.pow(2,btnNum+1)-2){

             // do whatever.  all buttons responded.

              }

          }

          1 person found this helpful