Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you import TXT files into Dynamic Text Box?

Status
Not open for further replies.

tyleri

Programmer
Jan 2, 2001
173
US
I am having the toughest time finding documentation on the simple step of just getting a dynamic text box to import the text file. can someone maybe point me to step-by-step instructions on the basics on how to do this? I am so helpless right now!!!
 
something I wanted to point out:

I don't want to have any buttons loading the text, I just want it to load when you get to it in the frame that the text box is in... is this possible?

basically - I have a menu on the main page of the flash - and when you click one of the items in the menu it goes to a certain frame number which then plays a movie.... inside this movie it loads a dynamic text box and stops (hopefully displaying the text in a text file).

i hope this clears things up.
 
You need to use the loadVariables command for this.

On the frame of your movie from which you want to call the textfile put this line into your actions panel...

loadVariables("textfile.txt",0);

The only other things you need to have set up are the format of the textfile and the dynamic box on the stage...

Make sure that the first thing in your textfile is the variable you want to use in your movie, e.g. ...

myVariable="the text for my movie";

Give your dynamic textbox the variable name myVariable and it will display the contents of your textfile.
 
Hey - i tried all that and for some reason nothing is working right.

my textfile name is "news.txt" in the body of the textfile I have this: News="blah news blah blah news";
on the frame that it stops at it has this:

"onClipEvent (load) [loadVariables ("news.txt", "0")]

and in the Variables section of the dynamic text box it says: News

the text should be a color that I can see clearly... I just don't see anything. What should I change?
 
Is the onClipEvent(load) necessary? Unless you have the textbox etc. in a separate movieclip that is loaded at that frame it shouldn't be. When you're loading variables into movieclips it's important to target things properly, the variables will be loaded into the _root of level 0 of your movie.

Try placing the textbox into a frame of the main movie on the _root level first of all just to check that you can make the principle work.

Once you know that you can load into the _root of the movie successfully it's easy then to point your movie clip at that variable using a path such as _root.News in your movieclip's textbox.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top