Skip to main content
Participant
December 9, 2011
Question

Make something happen after 4 MCs Play

  • December 9, 2011
  • 1 reply
  • 481 views

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

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 9, 2011

:

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.

    }

}