Introduction to Flash MX Tutorial > Load dynamic text at runtime

 

Load dynamic text at runtime

In the lesson Adding and Editing Text, you practiced typing text directly on the Stage. You can also design your movie to include text from external files. One of the easiest ways to accomplish this is to use the loadVariables action to load text from a text file into a dynamic text field at runtime. In the FLA file, you can specify text attributes, such as font style, size, and color, for the dynamic text field. An advantage of keeping text in external files is that anyone who wants to modify the text can work with the text file rather than the FLA file.

In this section, you'll learn how to accomplish the following tasks:

Import and align a logo

Create a dynamic text field

Use the Property inspector to assign a text variable name

Use the loadVariables action to load text from an external file

To complete this section, you can either continue to work on your mystiletto.fla file, or you can browse to your Flash MX application folder and open Tutorials/FlashIntro/stiletto4.fla. If you do use the stiletto4.fla file, save the file with a new name in your My_Stiletto folder to maintain an unadulterated version of the original file.