with addition to Xenophon precious info, the text file data should be on the form:
var1=value1&var2=value2&va
kanary.
Main Topics
Browse All TopicsHi,
If anyone can help me, please.
I need to know how to display a text file in a flash animation.
After the SWF loaded it will read a text file, "message.txt", and then displayed on the stage.
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
:)
and if u want to display the content of the text file, u should create a dynamic text and load the data into it.
create an empty dynamic text box, name it "Data" for example, then in the function above:
function dostuffwithfile()
{
Data.text=fileVar.var1;
}
//assuming u out write in the text file: var1=value1&var2=value2.
waiting ur comments klompen.
If using LoadVars(), how can I have multiple line text ?
First of all, what I really want to do is, I created a flash movie which read a "text" from file, and display the text in that movie.
So, next time I just simply edit the text, instead of edit the flash.
The text can be long, one or two paragraph.
I dont know about LoadVars() in the begining, but then I noticed that we need to add + for space and & for line termination. So I found that XML could be a lot of easier. Until now.
If your text has multiple lines...... then you could use HTML in the text that is in the text-file. The multi-line dynamic text should render the text as HTML (activate this option in text-properties)
Example:
&mytext=This is the first line.<br><br>This is the second line.&
Or have multiple lines in the text file and have 2 or 3 variables in flash:
&mytextline1=This is the first line.&
&mytextline2=This is the second line.&
A nice tutorial on flash using XML as input can be found here (including advice on when to and when not to use XML):
http://www.actionscript.or
Business Accounts
Answer for Membership
by: XenophonPosted on 2003-08-24 at 06:40:38ID: 9211784
In the text file: make the whole file a variable i.e
);
loadtext=This is the content of the textfile that I want loaded.... blah blah blah
In your flash frame:
function loadfile()
{
var fileVar = new loadVars();
fileVar.onLoad = dostuffwithfile;
fileVar.load("message.txt"
}
function dostuffwithfile()
{
trace(this.loadtext);
}
loadfile();
If you have any trouble please look up the loadVars object in the Flash actionscript dictionary (F1), as this is off the top of my head :S
hth
-X