Calling a Text File into Dynamic Text Field

I’m relatively new to Flash so please forgive any obvious questions! I’ve searched for ages and come up with lots of results about loading XML into Flash, but my problem is more basic than that.

I’m creating a site where each page is pretty much text. I want to achieve this by loading text files into dynamic text fields, since it’s easier for me to maintain text files that regenerate movie clips etc.

I have figured out how to load a text file into a dynamic text field and how to use the ‘read as HTML’ option to invoke HTML formatting - but I’ve hit the (apparently common, judging from Google) problem about whitespace. As soon as I have a carriage return in the text file, all subsequent text is ignored.

I’m detailing what I’ve done below and would really appreciate any help :slight_smile:

  1. Create flash document
  2. Add a dynamic text field
  3. Set the instance name of this text field to be ‘Text1’
  4. Set the ‘var’ for this text field to be ‘Text1’
  5. Created a text file in Notepad named 1.txt and saved in same location as the .fla
  6. In frame 1 (which also happens to be where the text field is placed) I have the following code:
loadVariables("1.txt", this);

I THINK I need to add some code somewhere about whitespace but I’m not sure what it is or where it should go…

Most of the above has been achieved through trial and error, copying things I’ve found online - not through any detailed understanding of what I’m doing so it is quite likely I’ve been stupid somewhere along the line!

Many thanks :slight_smile: