3 Replies Latest reply on Dec 1, 2008 7:57 AM by kglad

    What's wrong with this button code

    Level 7
      Dear All,

      I am trying to set up a button handler for many buttons rather just one. The
      intention of this code is to say if I press Load1 to Load40 that button and
      only that button's alpha should change to 50%. This code makes them all 50%
      alpha when the frame loads rather than on the onPress event.

      Can someone please help me out with this one?

      i = 0;
      while (i<40) {
      this["Load"+i].onPress = btnEvaluate(this["Load"+i]);
      ++i;
      }

      function btnEvaluate(target_btn:Button) {
      target_btn._alpha = 50;
      }

      Thanks again.

      Alastair MacFarlane