How to Load an External Text File Into Flash for Dynamic Websites

Flash movies are just one of the many ways that you can create dynamic interactive web pages. You can embed information within the Flash file itself, or load information from external text files. This can make it much easier to update your Flash based website as your business or projects grow and change.

Things You'll Need

  • Macromedia Flash
  • Text file
Show More

Instructions

    • 1

      Open Macromedia Flash. The basic commands in ActionScript have not radically changed through the versions of Flash, so these scripts should be good through a lot future Flash updates.

    • 2

      Open the "Text Tool" and draw a text box on your Flash document. The text box requires the following settings: "Dynamic Text" and "Multiline." Chose the font face, color and size of the text to be displayed. Provide the "Variable" name "sampleText."

    • 3

      Save the movie as "LoadingText.fla" into a directory called "sample."

    • 4

      Create a text file in Notepad and name it "sample.txt." Save it in the same directory as the LoadingText.fla file. Within this file type the following text "sampleText=This is a sample string of text." Save the changes to the file.

    • 5

      Switch back to the LoadingText.fla document in flash. Create a button on your Flash document and name it "button1."

    • 6

      Create a new actions layer for your button, and type the following ActionScript code in the first frame: button1.onRelease=function(){
      loadVariablesNum ("sample.txt", 0);
      }

    • 7

      Test your movie by running it, then clicking on the button you created. Make sure that your code references the same button names, variable names and file names which were created during the steps.

Related Searches:

Comments

You May Also Like

Related Ads

Featured