5 Replies Latest reply on Mar 29, 2007 2:55 PM by kglad

    Input text  and variable problem

    bknysh
      I've created an input text field and assigned it to a variable. When I try to perform actions on the variable, such as comparing it to the expected inputted text, I get unexpected results. Rather than simply having the inputted text assigned to the variable, I get complete formatting information assigned to the variable. When I do a trace on the variable name I see: "<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="24" COLOR="#000000" LETTERSPACING="0" KERNING="0">ch</FONT></P></TEXTFORMAT>". I don't have "Render Text as HTML" turned on.

      When I create a new Flash document on the same computer, this problem carries forward to the new document. When I created an identical document on another computer, with the same actionscript, I didn't have the problem (i.e., trace simply shows the text typed into the input field). When I open this good file on my computer, it works fine. When I create a new document after testing this one, the new document is fine. When I create a new document, I either get a good file or a bad file depending on which of the two documents I last tested.

      The code for duplicating the problem on my system is trivial. I create three frames with an input text box assigned to a variable name "testVariable". The three frames are:

      Frame 1:

      var testVariable = ""; // declare the variable and assigns it blank

      Frame 2:

      // Set up frame label for "Loop"

      Frame 3:

      trace (testVariable); // Display what is typed into the text box
      gotoandlay ("Loop"); // Loop back to frame 2.

      Anyone know why I'm getting the format assigned to the variable, and how to correct it? Also, why does this problem propagate to new documents if the problem document was the last to be used.

      Bryan