1 Reply Latest reply on Feb 22, 2008 2:12 AM by Greg Dove

    How to load variables from a .txt file

      I usually make a flash aplication in colaboration with a php programmer. But i want to test my swfs without having to wait for him. So i want to do that through a text file. I know that flash can load variables from text files. The problem is i don't know how to format the text file ( example.txt).

      Thank you
        • 1. Re: How to load variables from a .txt file
          Greg Dove Level 4
          Here's a couple of ideas.

          First you probably want to change what you have...and put your 'if (pVar==1' etc inside a separate function and call it from the onLoad handler after you have assigned the value to pVar... because the onLoad will run at some unknown point in time after loading has finished (actually in the test environment this might work... but that wouldn't be the same as what happens in a production setting).

          To create test files for loadvars... simply create a new as2 file and put this code on the first frame and test movie: