Welcome, Guest. Please login or register.
Did you miss your activation email?
02/07/12, 07:36
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  Flash 8 (Moderators: Jorge Solis, ..:: Mazhar Hasan ::.., Andresss)
| | |-+  on button press, how do I write variables to a text file
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: on button press, how do I write variables to a text file  (Read 806 times)
Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« on: 07/31/10, 10:34 »

This is my first time exploring this, so I'm pretty ignorant in where to start.

If I have two variables (ex. Time and x)
For every instance a certain button is pressed, how do I use actionscript 2 to continue to write to a text file and not overwrite the previous entry.

So it could record the time and other information every instance the button is pressed.

This will not run on a server/web, I would like this to be a stand alone build (Exe) app that will run on a computer

Thanks in advance
« Last Edit: 07/31/10, 10:38 by Jaylada » Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #1 on: 07/31/10, 12:48 »

just have a look into the guestbook sample.

It appends data to the existing file.

Question for things lik that is allways - what are you doing with the data later?

This question, or better the answer, leads you to: how do I store these?

It might be useful, writing the latest entry to the end of the file - this is the easyest, write it to the beginning (need te read the complete file, and append it to the new data, before you write the complete fale back to the system - this is how the guestbook works.
Or maybe you want to access data directly, then you can think of using a database, or write a file for each sequence.

Never the less, the main part is done by a php script (or any other serverside script).

For standalone, you have to use a thirdparty service, or compile for AIR.
Logged

happy flashing
Cool
Ronald
Jaylada
Seasoned Programmer
***
Posts: 142



View Profile WWW Email
« Reply #2 on: 08/15/10, 14:56 »

I haven't been able to get this to work yet (using Air).  I tried it using the guestbook as a starting point, but I wasn't able to get it to work with Air, although I really don't know the unique coding needed for air.
All I am going to do with the data, is capturing it for data gathering purposes, and evaluating it later, so I don't need dynamic access to it like the guestbook.

For PHP I would need the Apache server, correct?

Is there any other way of doing this without Air or loading on a server to my computer?

Logged
Ronald Wernecke
Administrator
Systems Administrator
*****
Posts: 6161


View Profile WWW Email
« Reply #3 on: 08/16/10, 12:49 »

If you are running this under air on your local mahine, you need to use the flash-file system object.
I dont know if this is available with flash 8.
Logged

happy flashing
Cool
Ronald
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything