11 Replies Latest reply on Mar 1, 2012 4:38 AM by Ned Murphy

    for statements and variable movie clip names?

    subtlefly72 Level 1

      Hi guys can you tell me why this doesnt work?

      (problem 1 is that I cannot call buttonmoce this way!)

      I am really trying to imporve my code writing and using arrays and for will save me writing this code over and over again

      Cheers

      sub

      var gss:Array= ["gss1","gss2","gss3","gss4","gss5"]

      for (var i= 0; i< 6; i++){

      gss[i].buttonMode=true;

       

       

      gss[i].addEventListener(MouseEvent.CLICK,gssgo);

      function gssgo(e:MouseEvent){

       

                if(e.currentTarget==gss[i]){

      trace(gss[i]);

       

       

       

       

      }

      gss[i].addEventListener(MouseEvent.ROLL_OUT,gssback);

      function gssback(e:MouseEvent){

       

                gss[i].play();

      }

      }

       

       

      }