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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving variable to text file in standalone app

Status
Not open for further replies.

orangejuice

Technical User
Nov 18, 2002
33
0
0
CA
I am using flash MX and am trying to do the following:
I have a dynamic input text field, and below it a "submit" button. When the user inputs some text and clicks "submit" I want this text to be sent to and saved in an external .txt file. This is all it has to do. I know it has something to do with variables - remember that this is for a CD application (eg standalone, no server interaction) so I don't think I can use back-end scripting. Please help!

Thx.
 
Yes, because of new restrictions (Flash player 6), you'll still have to use backend scripting, unless you can get by using the sharedObject, somewhat like a cookie...


Flash 5 did have an undocumented save feature, but that was removed in the Flash 6 player version.

Regards,

cubalibre2.gif
 
Is backend scripting, such as ASP or something usable on a CD rom application?? I've read a document on Flash and ASP integration, and understand the concept of sending variables back and forth, but don't think this will work on a cd - sounds like you need a web host. Any suggestions?? I'm just getting into programming and don't completely understand all the requirements for backend scripting...

What I'm really trying to do here is probably the impossible - everything I've read thus far has indicated that you can't create a search function within flash. Basically I want to create a dynamic text box, as described in my last post, when the user enters some text to search, have that text sent to an outside text file (or possible ASP?). Some outside script will search through a database and return a list of hits with that text in them. These hits will be clickable as links for the user. Sounds pretty impossible but maybe you have some suggestions? I don't know if sharedObject will work, but this might be a little too complex for it....
 
I've checked out the program but am not quite sure how this can be implemented... Have you used this to save variables to separate files? Any tips?
 
copied from their site :


Read from File - Read the file data.
Action : readFile

Syntex :
LP.exec("readFile", FileName, RemoveCR);

Example :
LP.exec("readFile", "C:\\My Documents\\test.xml", false);

Parameters :
FileName : File to read
RemoveCR : [PRO] Convert PC CR to Flash linefeed ?

Return Values :
readFile : The contect of the file

Detail Description :
Read the text form a file.

[PRO]
You can convert PC CR (Chr(13) + Chr(10) to Flash Line feed (Chr(10)) by
specifying true to the RemoveCR param.

-----------------------------------------
Write File - Write text / array / XML object to file
Action : write

Syntex :
LP.exec("write", FileName, Content, ConvertCR);

Example :
LP.exec("write", "C:\\My Documents\\test.xml", "HelloWorld", false);

Parameters :
FileName : The name of the file to save
Content : The content to write
ConvertCR : [PRO] Convert Flash linefeed with Hard CR?

Return Values :

Detail Description :
This let you write file to disk. You can pass text (single or multi line) ,
Array, XML objects,etc to the Content param to write to the file you
specify.

Note that it will overwrite former file if it exist. If you want to append
to old file, use appendFile.

[PRO]
ConvertCR is an true/false value which let you have a options to convert
Flash linefeed (Chr(10)) to standard PC CR/LF (Chr(13) + Chr(10)). This
make your text line feed correctly in other PC application like notepad.

You can also convert back the CR when you use the "read" action.

You can find more detail other other 100+ commands, properties, events etc inside the formal package LPManager

You need the .as file to publish your project and need to deliver
LPFlashEx.exe and LPFlashEx.ini with your projector.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top