| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
way of the other
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
|
can Flash 5 read the contents of a .txt file and parse it into a text box?
not sure if this is the correct terminology, but i want to create a .txt file, say containing financial info, and have it appear in my movie. the reason: so i can update multiple movies that will read from the .txt file, only having to update the .txt. thanks. this board is an invaluable resource. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
Sure, all you have to do is create a text box (field) on your stage (select dymanic text int he text inspector in Flash 5) and set the variable it holds to 'loadedtext' or seomthing.
Then create a text file with the following form: loadedtext=The String You Wish to Show In Your Text Box Save this as 'filename.txt' or the like, in the same directory as your .fla file. Then use loadVariable on the first frames of your movie clip as follows: loadVariablesNum ("filename.txt", 0); That will oad the variables fromt he text file into your flash movie on _level0, and they should show up in your text field. Cheers Jesse
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
|
|
|
#3 |
|
way of the other
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
|
it doesn't work. this is what i have:
loadVariables ("text.txt", 0); i have the .txt file in the same folder as the .swf but nothing comes up. do i have to point it to the text field or write something in the .txt file o get this to work? thanks for your help. |
|
|
|
|
|
#4 |
|
way of the other
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
|
i got it to work. thanks again for your help.
one other question: can i format the text in any way, say, to change it's font for different words or color, or maybe even to link some text to a URL? |
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
If you have Flash 5 you can check the HTML box and then use HTML code in your text file to format the color and add links. You cannot import images or do much more than change the color though. HTML support is still very basic.
Cheers Jesse
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
#6 |
|
way of the other
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
|
not sure how to format the .html file to have it read in flash. all i get is "Untitled Document", but nothing in the <body> tag.
any suggestions? |
|
|
|
|
|
#7 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
As far as I know you can't import fully fledge HTML files with BODY and HEAD commands and the like., I've only ever use stuff like COLOR and A HREF . With those I had no problems. Also stuff like table formatting seems not to work. Like I said, it's very basic level support.
Cheers Jesse
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
#8 |
|
way of the other
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
|
hey jesse - thanks for all of your help. i have another question:
i want to be able to have users input info and have that info formatted into xml... i think this is pretty easy, just predefine each text box to equal a certain <tag>..? but then.... how can i have that xml converted into html or similar web based code so that what they input can be read easily by other users or sent to a database? i guess the database part is done thru the <tags>, but i'm not sure of how to convert xml into html (css or xsl?) oh yeah! how do i do a mailto: without using getURL? thanks again for the time you spend on this board helping people less gifted with AS than you. tah! |
|
|
|
|
|
#9 |
|
Flash'a'holic
|
Hi to accomplish this with flash is possible, all you have to do is create your html page inside flash. By creating the correct html tags and placing them in the right order, from which you can then send to a server-side script which in-turn writes the html to a html document!
mailto cannot be done without the getUrl command: getURL("mailto:flashguru@flashkit.com") |
|
|
|
|
|
#10 |
|
Flash'a'holic
|
I dont have time this second to write you the flash script but i will do soon!
Its just a bit of xml |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| loading images into dynamic text boxes | mprovojr | ActionScript 2.0 | 5 | 10-09-2007 07:10 PM |
| Need Help! displaying external text files | Flash_Boi | ActionScript 2.0 | 7 | 03-30-2006 09:23 PM |
| Dynamic flash - external text files, please help!! | rickid | ActionScript 2.0 | 2 | 02-25-2005 04:38 PM |
| XML/ActionScript help pleeeeeeese....... | witchking | ActionScript 2.0 | 3 | 01-21-2005 07:42 AM |
| Help with HTML in dynamic text field... | puckett_jw | ActionScript 1.0 (and below) | 8 | 08-04-2003 01:58 AM |