2 Replies Latest reply on Oct 8, 2008 5:20 AM by Newsgroup_User

    toggle button

    tobycraftse Level 1
      I have 5 button with ID = but1, but2, but3, but4, but5

      I want to loop the buttons and create a click event to toggle the alpha of the buttons.

      but the following code doesn't work when looping each of the button IDs.

      how can I loop each button and set a Key event toggle?

      [CODE]

      functALL = new Array ( but1, but2, but3, but4, but5 );

      for ( i=0; i < functALL.length; i++){
      functALL .onRelease = function (){
      if (functALL
      ._alpha = 40 ){
      functALL ._alpha = 100;
      } else {
      functALL
      ._alpha = 40;
      }
      }
      }

      [/CODE]