1 Reply Latest reply on Mar 4, 2007 9:48 PM by Pal_w_G

    If statement question

    erokCom
      Hello friends,

      Let's say I have 3 movieClips on the stage. When I click them, they each alpha down to 0.

      Now, once they are all clicked and each of them have reached an alpha of 0, I want to fire a new event.. (Or have a message come up and say "You are finished clicking".

      Now, the buttons don't have a click order.. They can be clicked in any order.......

      Here is what I have so far:

      #include "mc_tween2.as"

      ///////////////////
      var _theMcAlpha:Number = 0;
      var _theMcAlphaTime:Number = 1;
      var _mcHolder:Array = new Array (boredomCloud_mc,failureCloudMC,immobileCloudMC)




      ///////////////////
      _mcHolder[0].onPress = function():Void {
      this.alphaTo(_theMcAlpha,_theMcAlphaTime)
      }


      ///////////////////
      _mcHolder[1].onPress = function():Void {
      this.alphaTo(_theMcAlpha,_theMcAlphaTime)
      }


      ///////////////////
      _mcHolder[2].onPress = function():Void {
      this.alphaTo(_theMcAlpha,_theMcAlphaTime)
      }
      ///////////////////



      This works fine for the fading of the MC's... But, I need to write some type of IF to check if they have all been clicked and faded down....

      Any advice?
        • 1. Re: If statement question
          Pal_w_G
          create a function and call it from every click.... Define a counter variable and increment it by each click...now you can have a if statement to check whether all the buttons have clicked.....

          or you can create an empty movie clip and use its onEnterFrame ..... now inside this eventHandler you can check whether all your clips has an alpha value of 0 and fire whatever you want.

          The choice is urs.