Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-11-2001, 10:13 PM   #1
flyrod
way of the other
 
flyrod's Avatar
 
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
Default

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.
flyrod is offline   Reply With Quote
Old 01-11-2001, 11:42 PM   #2
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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.
Jesse is offline   Reply With Quote
Old 01-12-2001, 02:32 AM   #3
flyrod
way of the other
 
flyrod's Avatar
 
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
Default

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.




flyrod is offline   Reply With Quote
Old 01-12-2001, 02:51 AM   #4
flyrod
way of the other
 
flyrod's Avatar
 
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
Default

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?

flyrod is offline   Reply With Quote
Old 01-12-2001, 06:23 AM   #5
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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.
Jesse is offline   Reply With Quote
Old 01-12-2001, 03:22 PM   #6
flyrod
way of the other
 
flyrod's Avatar
 
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
Default

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?
flyrod is offline   Reply With Quote
Old 01-13-2001, 02:53 AM   #7
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

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.
Jesse is offline   Reply With Quote
Old 01-19-2001, 04:23 PM   #8
flyrod
way of the other
 
flyrod's Avatar
 
Join Date: Jan 2001
Location: Brooklyn, NY
Posts: 107
Default

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!

flyrod is offline   Reply With Quote
Old 01-20-2001, 01:42 PM   #9
FlashGuru
Flash'a'holic
 
Join Date: Dec 2000
Location: London, UK
Posts: 82
Send a message via ICQ to FlashGuru
Default

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")



FlashGuru is offline   Reply With Quote
Old 01-20-2001, 01:43 PM   #10
FlashGuru
Flash'a'holic
 
Join Date: Dec 2000
Location: London, UK
Posts: 82
Send a message via ICQ to FlashGuru
Default

I dont have time this second to write you the flash script but i will do soon!

Its just a bit of xml
FlashGuru is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

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


All times are GMT. The time now is 09:33 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.