Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-20-2003, 03:57 AM   #1
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default [Q] How to Save Text File in Flash???

I just made a quick list of the methods on how you can create text file from Flash...

See if you can think of any other way of doing it, please add...
If you have good URL that explains any or all of the methods that I have listed, please add...
If you can provide any good information, please add...
If you see anything wrong, please correct me...


If you have question on this subject, please do not reply... Create you own thread...

---

How to Save Text File in Flash

SWF on Online
  • Save Locally in the User's hard drive - Shared Object
  • Save Remotely in the Server space - Server side script required
SWF on Offline
  • Save Locally in the User's hard drive FMX - Shared Object
  • Save Locally in the User's hard drive F5 - FSCommand Save
  • Save Remotely in the Server space - Server side script required
Flash Native Projector
  • Save Locally in the User's hard drive FMX - Shared Object
  • Save Locally in the User's hard drive F5 - FSCommand Save
  • Save Remotely in the Server space - Server side script required
Third Party Projector
  • Save Locally in the User's hard drive FMX - Shared Object & Most of the tools normally provide you the solution
  • Save Locally in the User's hard drive F5 - FSCommand Save
  • Save Remotely in the Server space - Server side script required & Some tools provides you the solution
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 02-15-2007, 08:22 AM   #2
vinayakk
Registered User
 
Join Date: Feb 2007
Posts: 1
Default save text using glash

Hello,

Message is too old to reply... but would definately help others.. please download the attached zip. It has a readme file along with it which would make clrear how to save text locally using Flash. Please be clear that flash on its alone does not has the capability to do this.. you need to use some
3rd party script in between to achieve this. I have used JavaScript.

Njoy!

Vinayak Kadam
Attached Files
File Type: zip save_text_flash.zip (7.7 KB, 15274 views)
vinayakk is offline   Reply With Quote
Old 06-22-2011, 12:42 PM   #3
dhil dhil senthil
Flash+Math=Magic
 
dhil dhil senthil's Avatar
 
Join Date: Jul 2009
Location: Chennai
Posts: 340
Default

Quote:
Originally Posted by vinayakk View Post
Hello,

Message is too old to reply... but would definately help others.. please download the attached zip. It has a readme file along with it which would make clrear how to save text locally using Flash. Please be clear that flash on its alone does not has the capability to do this.. you need to use some
3rd party script in between to achieve this. I have used JavaScript.

Njoy!

Vinayak Kadam

Hi vinay , thanks it helped me a lot...
__________________
www.thirstyneurons.com
--------
எண்ணென்ப ஏனை எழுத்தென்ப இவ்விரண்டும்
கண்ணென்ப வாழும் உயிர்க்கு.
--(Thirukkural, 392) (written 2000 years ago)
dhil dhil senthil is offline   Reply With Quote
Old 09-08-2011, 12:08 PM   #4
vishnubhatla
Registered User
 
Join Date: Apr 2010
Posts: 18
Default How to Save a File from Falsh As 3.0 (File Refference In As 3.0)

To do this First Create a button in Flash and name as "saveFileBut", and create input text filed and name as "myText" and copy and paste following code in first frame.


var saveFile:FileReference = new FileReference();
saveFileBut.addEventListener(MouseEvent.CLICK, saveMyFile);

function saveMyFile(e:MouseEvent): void {
saveFile.save(myTex.text);
}


Thanks,
K Swamy Vishnubhatla.
vishnubhatla is offline   Reply With Quote
Old 09-21-2011, 09:20 AM   #5
Beezle-Bug
Registered User
 
Join Date: Sep 2011
Posts: 1
Default

Hi,
your file is exactly what I need. unfortunately I don't get it working :-/ I already managed to overcome the flash security warning, but it doesn't write to file, yet. If I open the shell.swf outside a browser it opens a new browser tab called javascript:WriteToFile('test%20text') but then nothing else happens. any ideas? i really need to write a log file from as2...
Beezle-Bug is offline   Reply With Quote
Old 10-15-2011, 04:27 AM   #6
judthryn
Registered User
 
Join Date: Oct 2011
Posts: 2
Default

The code bellow saves the text in tMessage to the users computer. The code opens a dialog box that lets the user save the file to the local file system.

var tFR:FileReference = new FileReference();
var tMessage:String = 'Hello World';
tFR.save(tMessage, '.txt');

That is actually all the code you need. But lets explain what you can do with it. The class FileReference has a method called save with the following defenition.

public function save(data:*, defaultFileName:String = null):void
judthryn is offline   Reply With Quote
Old 03-09-2012, 10:34 PM   #7
anumber
Registered User
 
Join Date: Mar 2012
Posts: 1
Red face

Quote:
Originally Posted by judthryn View Post
The code bellow saves the text in tMessage to the users computer. The code opens a dialog box that lets the user save the file to the local file system.

var tFR:FileReference = new FileReference();
var tMessage:String = 'Hello World';
tFR.save(tMessage, '.txt');

That is actually all the code you need. But lets explain what you can do with it. The class FileReference has a method called save with the following defenition.

public function save(data:*, defaultFileName:String = null):void
It worked for me but it saves it as a file.

Questions:

Is there a way i can have is save with a .uc extension?
Is there a way i can have it save over a previous version without asking the user for the file name and the "Do you want to replace question"?
anumber is offline   Reply With Quote
Old 03-12-2012, 09:16 AM   #8
frad
Registered User
 
Join Date: Mar 2012
Posts: 1
Default

To save text file in the flash you can take help from the following code.The code bellow saves the text in tMessage to the users computer. The code opens a dialog box that lets the user save the file to the local file system.
var tFR:FileReference = new FileReference();
var tMessage:String = 'Hello World';
tFR.save(tMessage, '.txt');

__________________________
computer-support.igennie.net/

Last edited by frad; 03-12-2012 at 09:21 AM.
frad 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


All times are GMT. The time now is 01:19 AM.

///
Follow actionscriptorg on Twitter

 


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