11 Replies Latest reply on Sep 28, 2013 10:07 AM by kglad

    ErMsg[findIndexF(i)]._alpha= 100;

    Ron Colmen Level 2

      I want to be able to make the relevent ErMsg to alpha 100 if infoDats0 or infoDats1 text length is <=1. Below is my code and can't get it to work?

       

      var chkEk:Array = [chkE0, chkE1]

      var theTFa = new Array(infoDats0, infoDats1)

      var ErMsg = new Array(Field0, Field1) // alpha is set to 0 at the start

       

      function findIndexF(tf:TextField):Number{

                for(var i:Number=0;i<theTFa.length;i++){

                          if(tf==theTFa[i]){

                                    return i;

                          }

                }

      };

       

      goUp_btn.onRelease = function() {

      var chkE0 = infoDats0.text.split(' ').join('');

      var chkE1 = infoDats1.text.split(' ').join('');

       

                for(i=0; i<theTFa.length; i++){

                          if (chkE0.length>1 && chkE1.length>1){

                                    //doSome

                          } else {

                                    if (chkEk[i].length<=1){

                                              ErMsg[findIndexF(i)]._alpha= 100; //not working

                                    }

                          }

                }

      };