Skip to main content
Inspiring
March 19, 2008
Question

Loading a txt file

  • March 19, 2008
  • 5 replies
  • 403 views
Hi gang

So, I'm fairly new to AS3, so be gentle. I want to load a txt doc with some variables into my swf. I used to use loadVariables, but that's gone. Can anyone tell me the easiest way to load txt docs and access variables now?

Thanks,
Dan P.

This topic has been closed for replies.

5 replies

Participating Frequently
March 19, 2008
If you are interested in XML in ActionScript there are some video tutorials here:

www.gotoandlearn.com
Participating Frequently
March 19, 2008
Yes, white space will break this method. For more complex or larger amount of data XML is usually used.
Inspiring
March 19, 2008
Another question, dot he variables all have to be on one line continuously or can I put line breaks in? I tried to do it, but it broke... looks like the ampersand placement is key for this, right?
Inspiring
March 19, 2008
My hero. Thanks so much!

Dan P.
Participating Frequently
March 19, 2008
See attached code which loads in the following text file:

//-----BEGIN TEXT FILE myTextDoc.txt----------\\

var1=This is var 1&var2=This is var 2

//--------------------END TEXT FILE---------------------\\