> > Tutorials > T1096

Load html content from a text file and display it in an edit field of a Flash project.

Text file must be in the format:

text1=... your html code ...

You can use basic html tags: b, i , u, s, font face, font color, font size, a href

See an example


loading html

  1. Launch Alligator Flash Designer and choose “Blank document”.
  2. Choose “Frame” > “Frame Size” to set movie size to 600 x 250.
  3. Choose “Frame” > “ActionScript” and paste the following code:
    myData = new LoadVars();myData.onLoad = function() {  Edit1 = this.text1;};myData.load("");


  4. Choose “Edit Field” tool and draw an edit field.
  5. Choose “Select” tool. Double click the edit field, change “Variable name” to “Edit1” and check “HTML / Unicode” option.
  6. Choose Frame > Frame Delay and check Stop at this frame, click OK.
  7. Press F9 for preview.

Note that “text1” is used as variable name both in ActionScript and in your text file. You can use more variables in a single text file to load more edit fields at once.


get flash