1 Reply Latest reply on May 23, 2006 12:07 PM by Newsgroup_User

    Variable variables dynamically

    JstMrd
      Hello everyone (still raining where you are??)

      Basis of problem:

      Have input boxes on stage. Would like to compare the results to an array through a loop. I am not fully understanding how.

      Taking the existing Input Text Box Variable enter_1 (1- 14) and assigning the number to a standard variable when testing:

      enter_[x]
      enter_(x)
      [enter_+x]

      I have attached the loop code, but may not be on the right track.

      Thank You,
      D

        • 1. Re: Variable variables dynamically
          Level 7
          try:

          this["enter_"+countResponse]

          JstMrd wrote:

          > Hello everyone (still raining where you are??)
          >
          > Basis of problem:
          >
          > Have input boxes on stage. Would like to compare the results to an array
          > through a loop. I am not fully understanding how.
          >
          > Taking the existing Input Text Box Variable enter_1 (1- 14) and assigning the
          > number to a standard variable when testing:
          >
          > enter_[x]
          > enter_(x)
          > [enter_+x]
          >
          > I have attached the loop code, but may not be on the right track.
          >
          > Thank You,
          > D
          >
          >
          >
          > for (var countResponse:Number=1;countResponse<14;countResponse++) {
          > var nameCorrect:Number = 0;
          > trace(enter_[countResponse]);
          > for (var countNum:Number=1;countNum<43;countNum++) {
          > if (["enter_"+countResponse] = namesArray[countNum]) {
          > nameCorrect = (nameCorrect+1);
          > (output_[nameCorrect]) = (enter_[countResponse]);
          > trace(output_[countResponse]);
          > }
          > }
          > }
          >