PDA

View Full Version : [AS2] Saving variables to txt file?


harvy
05-08-2009, 06:40 PM
Hey just after some help with outputting to a text file with action script 2, in CS4.

The .swf will be running on a pc (no server), so I've tried :

fscommand("save","c:\file.txt")

on a button with no joy.

Ive started writing a quiz of sort, but need to output the answers to a file in a format that can be read in by another app (ideally csv).

any ideas?

ImOnCloudNine69
05-08-2009, 06:50 PM
as far as i know you cannot save to a text file in flash. you must use sendAndLoad or getURL to send the values to php, and use php to write to the text file.

harvy
05-08-2009, 06:57 PM
ive found that you can do it with JSFL? now its been a while since i last properly used Flash and AS, so not come across JSFL. Where does JSFL sit within Flash CS4? eg can i use it in a swf file? if so where can i add it in? does it sit alongside normal action script?

The info ive found on JSFL can be found here:http://www.peachpit.com/articles/article.aspx?p=170506

CyanBlue
05-08-2009, 06:59 PM
Howdy and Welcome... :)

JSFL only works inside the Flash IDE... That functionality does not go inside the SWF...
What you need is a third party projector tool that can help you save the data into a file... You might want to check on ones like SWF Studio, Zinc, mProjector...

harvy
05-08-2009, 07:05 PM
Howdy and Welcome... :)

JSFL only works inside the Flash IDE... That functionality does not go inside the SWF...
What you need is a third party projector tool that can help you save the data into a file... You might want to check on ones like SWF Studio, Zinc, mProjector...

Cheers,

Can you recommend any free projector tools or those that will also work on Mac OS?

harvy
05-08-2009, 07:24 PM
Ive got the trial version of SWF Studio, can anyone point me to where I can set it out output variables?

northcode
05-08-2009, 07:44 PM
var stuff:String = "save the contents of this string to a file";
ssCore.FileSys.writeToFile({path:"c:\\file.txt", data:stuff});

To make the FileSys plugin work you have to enable it on the Plugins Tab (http://www.northcode.com/v3/help/index.html?page=User%20Interface_Main%20%20Plugins %20Tab.html)