2 Replies Latest reply on Apr 24, 2006 6:49 AM by kaboom862

    Text arrays (variables) and Dynamic Text Box

    kaboom862 Level 1
      Hello everyone. I have a text file (let's call it sample.txt) that has numerous variables or arrays in this format:

      &info=This is some information
      &stuff=This is more stuff
      &whatever=Even more stuff again....

      Anyway, I need to load a particular variable via individual buttons from this same sample.txt file into a dynamic text box (let's call it dynText), and I am a bit lost as to how to do it. Please provide me a solution thank you.

      Glenn
        • 1. Re: Text arrays (variables) and Dynamic Text Box
          adireddy Level 1
          you need to disable buttons until the text file is loaded into flash...

          var txtlv:LoadVars = new LoadVars();
          txtlv.load("sample.txt");
          txtlv.onLoad = function(){
          // enable buttons here
          }

          on button click you can get the variables a below:

          dynText.text = txtlv.info;

          dynText.text = txtlv.stuff;

          etc...
          • 2. Re: Text arrays (variables) and Dynamic Text Box
            kaboom862 Level 1
            Thank you very much, it's greatly appreciated. It worked perfectly except that it does not like variables that begin with numbers like:

            &401_2b=401_2b

            The above doesn't work, but if I do this...

            &h401_2b=401_2b

            Everything is fine. Problem being, I am generating the variables via PHP and therefore cannot "change" them. Can you provide me with a way that ActionScript can "see" the variable that starts with a numeric value? Thanks for your time.

            Glenn