This content has been marked as final.
Show 4 replies
-
1. Loading text from a .txt file
IaguCool Sep 17, 2007 11:56 AM (in response to BruceCSI2)#include "filename.txt"
Note: without ";"!
No idea how to load a text file after you export the SWF... -
2. Re: Loading text from a .txt file
little*big*man Sep 17, 2007 1:16 PM (in response to BruceCSI2)Create the dynamic text box, and name it schedule.
Then, in the frame on the timeline that the text box resides in, the corresponding actionscript would be used to create a text variable and assign the text from a txt file to it:
loadText = new LoadVars();
loadText.load("externalfile.txt");
loadText.onLoad = function() {
schedule.text = this.textbody;
};
Where does the "textbody" variable come from? In the external text file (externalfile.txt in this example), you have a variable called textbody, and the externalfile.txt should read along the lines of:
textbody = "I'm the external text that needs to be read in" -
3. Re: Loading text from a .txt file
BruceCSI2 Sep 17, 2007 3:45 PM (in response to BruceCSI2)Thanks, but the text box reads "undefined" even though the text file is in the same folder as the flash file.... -
4. Re: Loading text from a .txt file
BruceCSI2 Sep 17, 2007 4:06 PM (in response to BruceCSI2)Actually, I just got it to work, but how do I change the background color of the text box?

