PDA

View Full Version : Pass text to string on ^*.txt


Capet
08-03-2008, 09:25 PM
Im searching on livedocs but nothing found about this.
I want to get text writen on a txt file and store it in a variable type string so the work should be:

on first page i code a textfield, then a submit button, submit button gets the string on textfield and writes down on a txt file ( <.. can i do this?)
then on second page i want each line of text to be stored like a variable string so i can play with it as i want.( showing , changing format, etc..)
My question is how can i acces inside a txt file, to get variables on strings stored in ??

Thx, u all :)

Capet
08-04-2008, 01:40 AM
i have installed AIR software for extending classes to get File methods but after installing all and watching AIR classes from Flash dev window (f9).....
Using Air classes, metthods etc,,, prompts always error.... like thers no linkage or whatever that classes do not exist........ What should i do????????? MESSSSSSSSSS !!!!!!!!!
For example :
var mytext:File = File.applicationDirectory;
mytext = mytext.resolvePath("text/");

pops errors
1046: Type was not found or was not a compile-time constant: File.
1120: Access of undefined property File.

nikefido
08-04-2008, 02:01 AM
you should use PHP (or other server side script) to read a txt file and echo out a string (aka echo out the text file) and then parse through that text in actionscript.

(one other option is to use URLLoader and URLRequest to load a .txt file - im pretty sure actionscript can handle text files as well as xml files).

However, if you are attempting to make "variables" from the text file, you might consider using an .xml file instead of .txt (and use xml format of course) which acrionscript can parse through very easily.

Capet
08-04-2008, 02:47 AM
thanks for ur time,, it has saved me tons of lost hours, really thanks,.