Be a Supporter!

How do i write text into a txt file

  • 356 Views
  • 8 Replies
New Topic Respond to this Topic
prut97
prut97
  • Member since: Sep. 22, 2007
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
How do i write text into a txt file 2009-02-10 13:33:49 Reply

If i have a var i need to write into a txt file ? Someone helped me once but resulted in it asked me where i want to save the file, i want it to just overwrite the file :)

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to How do i write text into a txt file 2009-02-10 14:07:11 Reply

You can't write directly to txt from Flash (although you CAN pull data in). To output data, you'll need to go through a PHP/ASP/CGI script first, which means basically running/having a server.

For AS2:
AS: Flash & PHP by shazwoogle
AS: Flash > ASP > Txt
AS: Load External Data/Cross-Domain
AS: Loading/Unloading Data by shazwoogle

If you want to simple save and load variables, you can use Flash cookies (sol files):
AS: Save and Load


- - Flash - Music - Images - -

BBS Signature
liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to How do i write text into a txt file 2009-02-10 14:21:42 Reply

At 2/10/09 01:33 PM, prut97 wrote: If i have a var i need to write into a txt file ? Someone helped me once but resulted in it asked me where i want to save the file, i want it to just overwrite the file :)

You can only write to a txt file if the prompt appears and the user chooses where the file is saved, you can't load/save files without user permission.. and even then it can only be done with the latest Flash Player with AS3 =P


Sup, bitches :)

BBS Signature
prut97
prut97
  • Member since: Sep. 22, 2007
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to How do i write text into a txt file 2009-02-10 14:27:28 Reply

LIES, I did it with AS2 b4.

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to How do i write text into a txt file 2009-02-10 14:29:46 Reply

At 2/10/09 02:27 PM, prut97 wrote: LIES, I did it with AS2 b4.

Well I suggest you rack your memory and try and remember how then


- - Flash - Music - Images - -

BBS Signature
LeechmasterB
LeechmasterB
  • Member since: Apr. 1, 2005
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to How do i write text into a txt file 2009-02-10 14:33:33 Reply

At 2/10/09 02:27 PM, prut97 wrote: LIES, I did it with AS2 b4.

Calling someone a liar and stating complete horseshit?! Seriously if you had the slightest bit of knowledge about flash and its restrictions you would never have said that. Does the term "sandbox" and "security" ring a bell? Wake up!

It is not possible to write to a users hard disk with flash without using other tools or scripts ect. Live with it.

TutorialPoo
TutorialPoo
  • Member since: Dec. 29, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to How do i write text into a txt file 2009-02-10 14:44:22 Reply

You could leave a cookie.

prut97
prut97
  • Member since: Sep. 22, 2007
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to How do i write text into a txt file 2009-02-10 15:03:47 Reply

At 2/10/09 02:33 PM, LeechmasterB wrote:
At 2/10/09 02:27 PM, prut97 wrote: LIES, I did it with AS2 b4.
Calling someone a liar and stating complete horseshit?! Seriously if you had the slightest bit of knowledge about flash and its restrictions you would never have said that. Does the term "sandbox" and "security" ring a bell? Wake up!

It is not possible to write to a users hard disk with flash without using other tools or scripts ect. Live with it.

I was talking to the guy who said that you could only do it with permision and it was only possible with AS3, i was told once how to do it, and it worked in AS2. And i don't wanna write to people's harddisk... To my website, Depending on stuff they write in inputs.

LeechmasterB
LeechmasterB
  • Member since: Apr. 1, 2005
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to How do i write text into a txt file 2009-02-10 15:06:48 Reply

Then you should try using

FLASH <-> PHP <-> SQL DATABASE

That will work... like suggested by the other guy.