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!

Dynamic Text from HTML file?

Status
Not open for further replies.

jazerr

Programmer
Dec 13, 2000
152
US
I have a text file of 100+ small blurbs of text such as "Goals are simply Dreams with deadlines." and other such hoohah.

I need to make a flash movie that selects these blurbs (one at a time) and fades them into a page and then fades out, and then selects the next line of text and does the same.

I need to know how to make this happen dynamically (so somebody else can add or remove blurbs later).

ANy ideas?
 
Have each saying in your text file as a separate variable in this kind of format:

blurb1=Goals are simply Dreams with deadlines&blurb2=whatever&blurb3= etc etc

Load them into your movie using

loadVariables("blurb.txt","");

or loadVariablesNum if you're targeting a specific level.

You can then use the variables directly, displaying them in a dynamic text box, or put them into an array and manipulate them any way you like. Slainte

 
loading a lot of variables using a txt file can be very slow. It's better to make just one string variable rather than repeat 'blurb1=***&blurb2=****'....... . Just write var blurb='sky is blue,wind is high,.........&loaded=done';
in Flash after checking that the var is loaded use myString=myString.split(',');
to make array myString;
 
You guys will have to forgive me, but I have <b>NO</b> flash experience. So I am actually going to need a 'start-to-finish' tutorial...the Flash tutorials dont include this...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top