4 Replies Latest reply on Sep 10, 2006 11:24 AM by Blue_Plate_Special

    loading dynamic text box in movie clip from .txt file

    MamboQueen
      I want to load a dynamic text field from an external text file.
      I have the following code which works perfectly as long as the dynamic text box is on the main stage:

      ----------------------------
      //Retrieve text field/value pair from file Test.txt
      loadText = new LoadVars();
      loadText.load("Test.txt");
      loadText.onLoad = loadTextVariables;

      //*** LOAD FUNCTION TO POPULATE TEXT BOX ***
      function loadTextVariables(success) {
      if (success) {
      //set text property of dynamic text box (txtBoxInst1) to value of loaded input variable (txtMsg1)
      _root.txtBoxInst1.text = this.txtMsg1;
      }
      } // end function loadTextVariables
      --------------------------------

      As soon as I put the dynamic text field in a movie clip (mcText1), however, the text does not appear.
      The only thing I change is this line in the function to refer to the instance name of a dynamic text field inside the movie clip:

      _root.mcText1.txtBoxInst1.text = this.txtMsg1;

      I would think that all I had to do was change the reference.... not?
      All thoughts would be appreciated.

      TIA,
      Carolyn