1. Open a notepad from start=> Propgrams=> accessories=> Notepad.
2. On your notepad you are going to type in several variable names and set them equal to a value. To start, just type in the variable name and set it equal to your name.
name=ladymindy
3. We need to let flash know we are dealing with variables so we will add the & infront of each variable name. Add the & in front of name so that it says
&name=ladymindy
4. Save this file as contactInfo.txt on your hard drive in the same folder you will put your project file.
5. Open Flash MX 2004 or more recent.Create a new movie and save it in the same project file you saved the text file.
6. Select your text tool. Create a text box on your stage. You can type any text you want in it to help you size it.
7. Switch to your selection tool The text box will remain selected wityh a blue outline. Open your Properties Inspector. Set the text to Dynamic, and give it an instance name of name_txt.
8. Add a layer on the timeline and give it the name of Actions. Click in frame 1 of the actions layer and open your actions panel. The first script we will add will set up an object or place, textFileData, for the movie to store the infor from the text file once we ask it to retreive the data. Type the following in the actions panel.
var textFileData:LoadVars = new LoadVars();
9. Now we will assign the variables to display in the text boxes we created. We will put this in a function statement. Type in the next line the following:
10. Once you have the place for the data prepared and the text box readied to display the data, you can now point the movie to read the text file to get the data. Add the next line to pick up the data from contactInfo.txt and store it in the textFileData container.:
textFileData.load("contactInfo.txt");
11. Test your movie. You will see that your name appears in the text box, even though it was never typed into the movie. It is only in the text file.
12. Open your text file. We will add more data. You are going to need to list the variables for name, address, city, state and zip code. Add to your list in the text file. Save your text file.
&name=ladymindy
&address=123 maple street
&city=Rochester
&state=NY
&zip=14607
13. We will need text fields for address_txt, city_txt, state_txt and zipcode_txt. Set the instance names on the separate text boxes
14. Click in Frame 1 of the actions layer. We will add the likes that will assign the rest of the data to the next text fields. Add the appropriate lines (the ones in blue below) so your resulting script looks like th is: