5 Replies Latest reply on Sep 8, 2011 1:05 PM by kglad

    for (k=0; k<fontN.length; k++){

    Ron Colmen Level 2

      There are 6 buttons and If this code is the only code in the fla why isn't the trace showing results? How can I make trace (fontN[k]) show which button I clicked??

       

       

      var fontN:Array = [Tx_btn1, Tx_btn2, Tx_btn3, Tx_btn4, Tx_btn5, Tx_btn6]; //buttons

      var fontF:Array = [format1, format2, format3, format4, format5, format6];

       

       

       

      for (k=0; k<fontN.length; k++){

          fontN[k].ivar=k;

      fontN[k].onRelease = function() {

      trace (fontN[k]) // it allways shows '_level0.Tx_btn6'

      my_txt.setNewTextFormat(fontF[this.ivar]);

      trace (fontF[this.ivar]) // 'undefined'

      }

      }